Modify

Opened 17 years ago

Closed 16 years ago

#526 closed enhancement (duplicate)

[patch] Geotagged: loading a large number of pictures

Reported by: christian.gallioz@… 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 anonymous, 17 years ago

Component: CorePlugin

comment:2 by Harry Wood, 17 years ago

Anyone applied this fix?

maybe this is a duplicate of bug #84 actually

comment:3 by Hasienda, 16 years ago

Resolution: duplicate
Status: newclosed
Summary: Geotagged : loading a large number of pictures[patch] Geotagged: loading a large number of pictures

A comment in #84 from the reporter of this ticket here actually announces this ticket as duplicate pf #84 since 11 months now.

The hint to the proposed fix here was already set. Nothing left to be done but finally labeling this correctly.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.