Opened 17 years ago
Closed 16 years ago
#526 closed enhancement (duplicate)
[patch] Geotagged: loading a large number of pictures
Reported by: | Owned by: | framm | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Plugin | Version: | latest |
Keywords: | Geotagged plugin | Cc: |
Description
Thank you for the Geotagged plugin, it's very useful. But I have a little problem with it when I try to load a large number of pictures : the system hangs and I have to stop JOSM. The cause is the memory used by the original pictures, which is not released the thumbnails are done => So the system swaps and all becomes very slow.
I looked to the GeotaggedLayer class, and made some little code changes to make the large pictures being released :
- in loadScaledImage(File f, int maxSize) :
Image img = new ImageIcon(f.getPath()).getImage();
becomes :
Image img = Toolkit.getDefaultToolkit().createImage(f.getPath()); while (img.getWidth(null) < 0 || img.getHeight(null) < 0) { try { Thread.sleep(10); } catch(InterruptedException ie) { } }
- in createResizedCopy(Image originalImage, int scaledWidth, int scaledHeight) :
g.drawImage(originalImage, 0, 0, scaledWidth, scaledHeight, null);
becomes :
while (! g.drawImage(originalImage, 0, 0, scaledWidth, scaledHeight, null)) { try { Thread.sleep(10); } catch(InterruptedException ie) { } }
- You also have to import java.awt.Toolkit.
Now, it works fine (I tried to load 215 pictures and it worked).
Attachments (0)
Change History (3)
comment:1 by , 17 years ago
Component: | Core → Plugin |
---|
comment:2 by , 17 years ago
comment:3 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Summary: | Geotagged : loading a large number of pictures → [patch] Geotagged: loading a large number of pictures |
Anyone applied this fix?
maybe this is a duplicate of bug #84 actually