﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
526	[patch] Geotagged: loading a large number of pictures	christian.gallioz@…	framm	"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)."	enhancement	closed	minor		Plugin	latest	duplicate	Geotagged plugin	
