Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java	(revision 12747)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojDialog.java	(revision 12778)
@@ -1,4 +1,4 @@
 // License: GPL. Copyright 2007 by Christian Gallioz (aka khris78)
-// Parts of code from Geotagged plugin (by Rob Neild) 
+// Parts of code from Geotagged plugin (by Rob Neild)
 // and the core JOSM source code (by Immanuel Scholz and others)
 
@@ -34,8 +34,8 @@
     private ImageDisplay imgDisplay = new ImageDisplay();
     private boolean centerView = false;
-    
+
     // Only one instance of that class
     static private AgpifojDialog INSTANCE = null;
-    
+
     public static AgpifojDialog getInstance() {
         if (INSTANCE == null) {
@@ -51,17 +51,17 @@
             throw new IllegalStateException("Agpifoj dialog should not be instanciated twice !");
         }
-        
+
         INSTANCE = this;
-        
+
         JPanel content = new JPanel();
         content.setLayout(new BorderLayout());
 
         content.add(imgDisplay, BorderLayout.CENTER);
-        
+
         JPanel buttons = new JPanel();
         buttons.setLayout(new FlowLayout());
-        
+
         JButton button;
-        
+
         Dimension buttonDim = new Dimension(26,26);
         button = new JButton();
@@ -72,5 +72,5 @@
         button.setPreferredSize(buttonDim);
         buttons.add(button);
-        
+
         button = new JButton();
         button.setIcon(ImageProvider.get("dialogs", "delete"));
@@ -80,5 +80,5 @@
         button.setPreferredSize(buttonDim);
         buttons.add(button);
-        
+
         button = new JButton();
         button.setIcon(ImageProvider.get("dialogs", "next"));
@@ -88,5 +88,5 @@
         button.setPreferredSize(buttonDim);
         buttons.add(button);
-        
+
         JToggleButton tb = new JToggleButton();
         tb.setIcon(ImageProvider.get("dialogs", "centreview"));
@@ -96,5 +96,5 @@
         tb.setPreferredSize(buttonDim);
         buttons.add(tb);
-        
+
         button = new JButton();
         button.setIcon(ImageProvider.get("dialogs", "zoom-best-fit"));
@@ -104,9 +104,9 @@
         button.setPreferredSize(buttonDim);
         buttons.add(button);
-        
+
         content.add(buttons, BorderLayout.SOUTH);
 
         add(content, BorderLayout.CENTER);
-        
+
     }
 
@@ -120,5 +120,5 @@
                 currentLayer.showPreviousPhoto();
             }
-            
+
         } else if (COMMAND_CENTERVIEW.equals(e.getActionCommand())) {
             centerView = ((JToggleButton) e.getSource()).isSelected();
@@ -126,8 +126,8 @@
                 Main.map.mapView.zoomTo(currentEntry.pos, Main.map.mapView.getScale());
             }
-            
+
         } else if (COMMAND_ZOOM.equals(e.getActionCommand())) {
             imgDisplay.zoomBestFitOrOne();
-            
+
         } else if (COMMAND_REMOVE.equals(e.getActionCommand())) {
             if (currentLayer != null) {
@@ -135,5 +135,5 @@
             }
         }
-        
+
     }
 
@@ -144,5 +144,5 @@
     private AgpifojLayer currentLayer = null;
     private ImageEntry currentEntry = null;
-    
+
     public void displayImage(AgpifojLayer layer, ImageEntry entry) {
         synchronized(this) {
@@ -151,5 +151,5 @@
                 return;
             }
-        
+
             if (centerView && Main.map != null && entry != null && entry.pos != null) {
                 Main.map.mapView.zoomTo(entry.pos, Main.map.mapView.getScale());
@@ -159,5 +159,5 @@
             currentEntry = entry;
         }
-        
+
         if (entry != null) {
             imgDisplay.setImage(entry.file);
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java	(revision 12747)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java	(revision 12778)
@@ -1,4 +1,4 @@
 // License: GPL. Copyright 2007 by Christian Gallioz (aka khris78)
-// Parts of code from Geotagged plugin (by Rob Neild) 
+// Parts of code from Geotagged plugin (by Rob Neild)
 // and the core JOSM source code (by Immanuel Scholz and others)
 
@@ -48,10 +48,10 @@
 
     List<ImageEntry> data;
-    
+
     private Icon icon = ImageProvider.get("dialogs/agpifoj-marker");
     private Icon selectedIcon = ImageProvider.get("dialogs/agpifoj-marker-selected");
-    
+
     private int currentPhoto = -1;
-    
+
     /*
      * Stores info about each image
@@ -83,7 +83,7 @@
 
     /** Loads a set of images, while displaying a dialog that indicates what the plugin is currently doing.
-     * In facts, this object is instantiated with a list of files. These files may be JPEG files or 
-     * directories. In case of directories, they are scanned to find all the images they contain. 
-     * Then all the images that have be found are loaded as ImageEntry instances. 
+     * In facts, this object is instantiated with a list of files. These files may be JPEG files or
+     * directories. In case of directories, they are scanned to find all the images they contain.
+     * Then all the images that have be found are loaded as ImageEntry instances.
      */
     private static final class Loader extends PleaseWaitRunnable {
@@ -93,5 +93,5 @@
         private final File[] selection;
         private HashSet<String> loadedDirectories = new HashSet<String>();
-        
+
         public Loader(File[] selection) {
             super(tr("Extracting GPS locations from EXIF"));
@@ -108,9 +108,9 @@
                 errorMessage += tr("One of the selected files was null !!!");
             }
-            
+
             if (cancelled) {
                 return;
             }
-            
+
             Main.pleaseWaitDlg.currentAction.setText(tr("Read photos..."));
 
@@ -121,5 +121,5 @@
             Main.pleaseWaitDlg.progress.setMaximum(files.size());
             Main.pleaseWaitDlg.progress.setValue(progress);
-            
+
             for (File f : files) {
 
@@ -149,16 +149,16 @@
         }
 
-        private void addRecursiveFiles(List<File> files, File[] sel) { 
+        private void addRecursiveFiles(List<File> files, File[] sel) {
             boolean nullFile = false;
-            
+
             for (File f : sel) {
-                
+
                 if(cancelled) {
                     break;
                 }
-                
+
                 if (f == null) {
                     nullFile = true;
-                    
+
                 } else if (f.isDirectory()) {
                     String canonical = null;
@@ -167,8 +167,8 @@
                     } catch (IOException e) {
                         e.printStackTrace();
-                        errorMessage += tr("Unable to get canonical path for directory {0}\n", 
+                        errorMessage += tr("Unable to get canonical path for directory {0}\n",
                                            f.getAbsolutePath());
                     }
-                    
+
                     if (canonical == null || loadedDirectories.contains(canonical)) {
                         continue;
@@ -176,5 +176,5 @@
                         loadedDirectories.add(canonical);
                     }
-                    
+
                     File[] children = f.listFiles(AgpifojPlugin.JPEG_FILE_FILTER);
                     if (children != null) {
@@ -189,10 +189,10 @@
                         errorMessage += tr("Error while getting files from directory {0}\n", f.getPath());
                     }
-                    
+
                 } else {
                       files.add(f);
                 }
             }
-            
+
             if (nullFile) {
                 throw new NullPointerException();
@@ -251,5 +251,5 @@
     @Override
     public Component[] getMenuEntries() {
-        
+
         JMenuItem correlateItem = new JMenuItem(tr("Correlate to GPX"), ImageProvider.get("dialogs/gpx2img"));
         correlateItem.addActionListener(new CorrelateGpxWithImages(this));
@@ -283,12 +283,12 @@
         AgpifojLayer l = (AgpifojLayer) from;
 
-        ImageEntry selected = null; 
+        ImageEntry selected = null;
         if (l.currentPhoto >= 0) {
             selected = l.data.get(l.currentPhoto);
         }
-        
+
         data.addAll(l.data);
         Collections.sort(data);
-        
+
         // Supress the double photos.
         if (data.size() > 1) {
@@ -304,5 +304,5 @@
             }
         }
-        
+
         if (selected != null) {
             for (int i = 0; i < data.size() ; i++) {
@@ -314,7 +314,7 @@
             }
         }
-        
+
         name = l.name;
-        
+
     }
 
@@ -324,5 +324,5 @@
         int iconWidth = icon.getIconWidth() / 2;
         int iconHeight = icon.getIconHeight() / 2;
-        
+
         for (ImageEntry e : data) {
             if (e.pos != null) {
@@ -331,10 +331,10 @@
                 Rectangle r = new Rectangle(p.x - iconWidth,
                                             p.y - iconHeight,
-                                            icon.getIconWidth(), 
+                                            icon.getIconWidth(),
                                             icon.getIconHeight());
                 icon.paintIcon(mv, g, r.x, r.y);
             }
         }
-        
+
         // Draw the selection on top of the other pictures.
         if (currentPhoto >= 0 && currentPhoto < data.size()) {
@@ -346,5 +346,5 @@
                 Rectangle r = new Rectangle(p.x - selectedIcon.getIconWidth() / 2,
                                             p.y - selectedIcon.getIconHeight() / 2,
-                                            selectedIcon.getIconWidth(), 
+                                            selectedIcon.getIconWidth(),
                                             selectedIcon.getIconHeight());
                 selectedIcon.paintIcon(mv, g, r.x, r.y);
@@ -361,5 +361,5 @@
     /*
      * Extract gps from image exif
-     * 
+     *
      * If successful, fills in the LatLon and EastNorth attributes of passed in
      * image;
@@ -414,5 +414,5 @@
         }
     }
-    
+
     public void showNextPhoto() {
         if (data != null && data.size() > 0) {
@@ -427,5 +427,5 @@
         Main.main.map.repaint();
     }
-    
+
     public void showPreviousPhoto() {
         if (data != null && data.size() > 0) {
@@ -440,5 +440,5 @@
         Main.main.map.repaint();
     }
-    
+
     public void removeCurrentPhoto() {
         if (data != null && data.size() > 0 && currentPhoto >= 0 && currentPhoto < data.size()) {
@@ -455,5 +455,5 @@
         Main.main.map.repaint();
     }
-    
+
     private MouseAdapter mouseAdapter = null;
 
@@ -481,7 +481,7 @@
                         continue;
                     Point p = Main.map.mapView.getPoint(e.pos);
-                    Rectangle r = new Rectangle(p.x - icon.getIconWidth() / 2, 
-                                                p.y - icon.getIconHeight() / 2, 
-                                                icon.getIconWidth(), 
+                    Rectangle r = new Rectangle(p.x - icon.getIconWidth() / 2,
+                                                p.y - icon.getIconHeight() / 2,
+                                                icon.getIconWidth(),
                                                 icon.getIconHeight());
                     if (r.contains(ev.getPoint())) {
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojPlugin.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojPlugin.java	(revision 12747)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojPlugin.java	(revision 12778)
@@ -1,4 +1,4 @@
 // License: GPL. Copyright 2007 by Christian Gallioz (aka khris78)
-// Parts of code from Geotagged plugin (by Rob Neild) 
+// Parts of code from Geotagged plugin (by Rob Neild)
 // and the core JOSM source code (by Immanuel Scholz and others)
 
@@ -23,8 +23,8 @@
 
 public class AgpifojPlugin extends Plugin {
-    
-    static class JpegFileFilter extends javax.swing.filechooser.FileFilter 
+
+    static class JpegFileFilter extends javax.swing.filechooser.FileFilter
                                         implements java.io.FileFilter {
-        
+
         @Override public boolean accept(File f) {
             if (f.isDirectory()) {
@@ -40,7 +40,7 @@
         }
     };
-    
+
     static final JpegFileFilter JPEG_FILE_FILTER = new JpegFileFilter();
-    
+
     private class Action extends JosmAction {
 
@@ -59,18 +59,18 @@
             fc.setAcceptAllFileFilterUsed(false);
             fc.setFileFilter(JPEG_FILE_FILTER);
-            
+
             fc.showOpenDialog(Main.parent);
-            
+
             File[] sel = fc.getSelectedFiles();
             if (sel == null || sel.length == 0) {
                 return;
             }
-            
+
             Main.pref.put("tagimages.lastdirectory", fc.getCurrentDirectory().getPath());
-            
+
             AgpifojLayer.create(sel);
         }
     }
-    
+
     public AgpifojPlugin() {
         MainMenu.add(Main.main.menu.fileMenu, new Action());
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 12747)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 12778)
@@ -1,4 +1,4 @@
 // License: GPL. Copyright 2007 by Christian Gallioz (aka khris78)
-// Parts of code from Geotagged plugin (by Rob Neild) 
+// Parts of code from Geotagged plugin (by Rob Neild)
 // and the core JOSM source code (by Immanuel Scholz and others)
 
@@ -64,5 +64,5 @@
 import org.xml.sax.SAXException;
 
-/** This class displays the window to select the GPX file and the offset (timezone + delta). 
+/** This class displays the window to select the GPX file and the offset (timezone + delta).
  * Then it correlates the images of the layer with that GPX file.
  */
@@ -76,23 +76,23 @@
         long offset;
     }
-    
+
     AgpifojLayer yLayer = null;
-    
+
     private static class GpxDataWrapper {
         String name;
         GpxData data;
         File file;
-        
+
         public GpxDataWrapper(String name, GpxData data, File file) {
             this.name = name;
-            this.data = data; 
+            this.data = data;
             this.file = file;
         }
-        
+
         public String toString() {
             return name;
         }
     }
-    
+
     Vector gpxLst = new Vector();
     JPanel panel = null;
@@ -103,10 +103,10 @@
     JRadioButton rbUntaggedImg = null;
     JRadioButton rbNoExifImg = null;
-    
-    /** This class is called when the user doesn't find the GPX file he needs in the files that have 
+
+    /** This class is called when the user doesn't find the GPX file he needs in the files that have
      * been loaded yet. It displays a FileChooser dialog to select the GPX file to be loaded.
-     */ 
+     */
     private class LoadGpxDataActionListener implements ActionListener {
-        
+
         public void actionPerformed(ActionEvent arg0) {
             JFileChooser fc = new JFileChooser(Main.pref.get("lastDirectory"));
@@ -118,5 +118,5 @@
                 @Override public boolean accept(File f) {
                     return (f.isDirectory()
-                            || f .getName().toLowerCase().endsWith(".gpx") 
+                            || f .getName().toLowerCase().endsWith(".gpx")
                             || f.getName().toLowerCase().endsWith(".gpx.gz"));
                 }
@@ -129,17 +129,17 @@
             if (sel == null)
                 return;
-            
+
             try {
                 panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
-                
+
                 Main.pref.put("lastDirectory", sel.getPath());
-                
+
                 for (int i = gpxLst.size() - 1 ; i >= 0 ; i--) {
                     if (gpxLst.get(i) instanceof GpxDataWrapper) {
-                        GpxDataWrapper wrapper = (GpxDataWrapper) gpxLst.get(i); 
+                        GpxDataWrapper wrapper = (GpxDataWrapper) gpxLst.get(i);
                         if (sel.equals(wrapper.file)) {
                             cbGpx.setSelectedIndex(i);
                             if (!sel.getName().equals(wrapper.name)) {
-                                JOptionPane.showMessageDialog(Main.parent, 
+                                JOptionPane.showMessageDialog(Main.parent,
                                         tr("File {0} is loaded yet under the name \"{1}\"", sel.getName(), wrapper.name));
                             }
@@ -154,9 +154,9 @@
                         iStream = new GZIPInputStream(new FileInputStream(sel));
                     } else {
-                        iStream = new FileInputStream(sel); 
+                        iStream = new FileInputStream(sel);
                     }
                     data = new GpxReader(iStream, sel).data;
                     data.storageFile = sel;
-               
+
                 } catch (SAXException x) {
                     x.printStackTrace();
@@ -168,5 +168,5 @@
                     return;
                 }
-                
+
                 loadedGpxData.add(data);
                 if (gpxLst.get(0) instanceof String) {
@@ -180,9 +180,9 @@
         }
     }
-    
-    /** This action listener is called when the user has a photo of the time of his GPS receiver. It 
+
+    /** This action listener is called when the user has a photo of the time of his GPS receiver. It
      * displays the list of photos of the layer, and upon selection displays the selected photo.
-     * From that photo, the user can key in the time of the GPS. 
-     * Then values of timezone and delta are set. 
+     * From that photo, the user can key in the time of the GPS.
+     * Then values of timezone and delta are set.
      * @author chris
      *
@@ -195,5 +195,5 @@
         ImageDisplay imgDisp;
         JList imgList;
-        
+
         public void actionPerformed(ActionEvent arg0) {
             SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
@@ -203,14 +203,14 @@
             panel.add(new JLabel(tr("<html>Take a photo of your GPS receiver while it displays the time.<br>"
                                     + "Display that photo here.<br>"
-                                    + "And then, simply capture the time you read on the photo and select a timezone<hr></html>")), 
+                                    + "And then, simply capture the time you read on the photo and select a timezone<hr></html>")),
                                     BorderLayout.NORTH);
-            
+
             imgDisp = new ImageDisplay();
             imgDisp.setPreferredSize(new Dimension(300, 225));
             panel.add(imgDisp, BorderLayout.CENTER);
-            
+
             JPanel panelTf = new JPanel();
             panelTf.setLayout(new GridBagLayout());
-            
+
             GridBagConstraints gc = new GridBagConstraints();
             gc.gridx = gc.gridy = 0;
@@ -227,5 +227,5 @@
             gc.gridwidth = 2;
             panelTf.add(lbExifTime, gc);
-            
+
             gc.gridx = 0;
             gc.gridy = 1;
@@ -247,5 +247,5 @@
             gc.weightx = 0.2;
             panelTf.add(new JLabel(tr(" [dd/mm/yyyy hh:mm:ss]")), gc);
-            
+
             gc.gridx = 0;
             gc.gridy = 2;
@@ -255,11 +255,11 @@
             gc.anchor = GridBagConstraints.WEST;
             panelTf.add(new JLabel(tr("I'm in the timezone of: ")), gc);
-            
+
             Vector vtTimezones = new Vector<String>();
             String[] tmp = TimeZone.getAvailableIDs();
-            
+
             for (String tzStr : tmp) {
                 TimeZone tz = TimeZone.getTimeZone(tzStr);
-                 
+
                 String tzDesc = new StringBuffer(tzStr).append(" (")
                                         .append(formatTimezone(tz.getRawOffset() / 3600000.0))
@@ -267,9 +267,9 @@
                 vtTimezones.add(tzDesc);
             }
-            
+
             Collections.sort(vtTimezones);
-            
+
             cbTimezones = new JComboBox(vtTimezones);
-            
+
             String tzId = Main.pref.get("tagimages.timezoneid", "");
             TimeZone defaultTz;
@@ -279,9 +279,9 @@
                 defaultTz = TimeZone.getTimeZone(tzId);
             }
-            
+
             cbTimezones.setSelectedItem(new StringBuffer(defaultTz.getID()).append(" (")
                     .append(formatTimezone(defaultTz.getRawOffset() / 3600000.0))
                     .append(')').toString());
-            
+
             gc.gridx = 1;
             gc.weightx = 1.0;
@@ -289,10 +289,10 @@
             gc.fill = GridBagConstraints.HORIZONTAL;
             panelTf.add(cbTimezones, gc);
-            
+
             panel.add(panelTf, BorderLayout.SOUTH);
 
             JPanel panelLst = new JPanel();
             panelLst.setLayout(new BorderLayout());
-            
+
             imgList = new JList(new AbstractListModel() {
                 public Object getElementAt(int i) {
@@ -312,9 +312,9 @@
                     Date date = yLayer.data.get(index).time;
                     if (date != null) {
-                        lbExifTime.setText(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(date));                    
+                        lbExifTime.setText(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(date));
                         tfGpsTime.setText(new SimpleDateFormat("dd/MM/yyyy ").format(date));
                         tfGpsTime.setCaretPosition(tfGpsTime.getText().length());
                         tfGpsTime.setEnabled(true);
-                    } else {                        
+                    } else {
                         lbExifTime.setText(tr("No date"));
                         tfGpsTime.setText("");
@@ -322,8 +322,8 @@
                     }
                 }
-                
+
             });
             panelLst.add(new JScrollPane(imgList), BorderLayout.CENTER);
-            
+
             JButton openButton = new JButton(tr("Open an other photo"));
             openButton.addActionListener(new ActionListener() {
@@ -349,8 +349,8 @@
                     }
                     if (date != null) {
-                        lbExifTime.setText(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(date));                    
+                        lbExifTime.setText(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(date));
                         tfGpsTime.setText(new SimpleDateFormat("dd/MM/yyyy ").format(date));
                         tfGpsTime.setEnabled(true);
-                    } else {                        
+                    } else {
                         lbExifTime.setText(tr("No date"));
                         tfGpsTime.setText("");
@@ -360,7 +360,7 @@
             });
             panelLst.add(openButton, BorderLayout.PAGE_END);
-            
+
             panel.add(panelLst, BorderLayout.LINE_START);
-            
+
             boolean isOk = false;
             while (! isOk) {
@@ -370,32 +370,32 @@
                 }
 
-                long delta; 
-                   
+                long delta;
+
                 try {
-                    delta = dateFormat.parse(lbExifTime.getText()).getTime() 
+                    delta = dateFormat.parse(lbExifTime.getText()).getTime()
                             - dateFormat.parse(tfGpsTime.getText()).getTime();
                 } catch(ParseException e) {
-                    JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing the date.\n" 
-                            + "Please use the requested format"), 
+                    JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing the date.\n"
+                            + "Please use the requested format"),
                             tr("Invalid date"), JOptionPane.ERROR_MESSAGE );
                     continue;
                 }
-                
+
                 String selectedTz = (String) cbTimezones.getSelectedItem();
                 int pos = selectedTz.lastIndexOf('(');
                 tzId = selectedTz.substring(0, pos - 1);
-                String tzValue = selectedTz.substring(pos + 1, selectedTz.length() - 1); 
-                
+                String tzValue = selectedTz.substring(pos + 1, selectedTz.length() - 1);
+
                 Main.pref.put("tagimages.timezoneid", tzId);
                 tfOffset.setText(Long.toString(delta / 1000));
                 tfTimezone.setText(tzValue);
-                
+
                 isOk = true;
-                
-            }
-            
-        }
-    }
-    
+
+            }
+
+        }
+    }
+
     public CorrelateGpxWithImages(AgpifojLayer layer) {
         this.yLayer = layer;
@@ -409,39 +409,39 @@
             Layer cur = iterLayer.next();
             if (cur instanceof GpxLayer) {
-                gpxLst.add(new GpxDataWrapper(((GpxLayer) cur).name, 
-                                              ((GpxLayer) cur).data, 
-                                              ((GpxLayer) cur).data.storageFile)); 
+                gpxLst.add(new GpxDataWrapper(((GpxLayer) cur).name,
+                                              ((GpxLayer) cur).data,
+                                              ((GpxLayer) cur).data.storageFile));
             }
         }
         for (GpxData data : loadedGpxData) {
-            gpxLst.add(new GpxDataWrapper(data.storageFile.getName(), 
+            gpxLst.add(new GpxDataWrapper(data.storageFile.getName(),
                                           data,
-                                          data.storageFile)); 
-        }
-        
+                                          data.storageFile));
+        }
+
         if (gpxLst.size() == 0) {
             gpxLst.add(tr("<No GPX track loaded yet>"));
         }
-        
+
         JPanel panelCb = new JPanel();
         panelCb.setLayout(new FlowLayout());
-        
+
         panelCb.add(new JLabel(tr("GPX track: ")));
-        
+
         cbGpx = new JComboBox(gpxLst);
         panelCb.add(cbGpx);
-        
+
         JButton buttonOpen = new JButton(tr("Open another GPX trace"));
         buttonOpen.setIcon(ImageProvider.get("agpifoj-open"));
         buttonOpen.addActionListener(new LoadGpxDataActionListener());
-        
+
         panelCb.add(buttonOpen);
-        
+
         JPanel panelTf = new JPanel();
         panelTf.setLayout(new GridBagLayout());
-        
+
         GridBagConstraints gc = new GridBagConstraints();
         gc.anchor = GridBagConstraints.WEST;
-        
+
         gc.gridx = gc.gridy = 0;
         gc.gridwidth = gc.gridheight = 1;
@@ -464,5 +464,5 @@
         gc.weighty = 0.0;
         panelTf.add(tfTimezone, gc);
-        
+
         gc.gridx = 0;
         gc.gridy = 1;
@@ -493,5 +493,5 @@
         gc.weighty = 1.0;
         panelTf.add(buttonViewGpsPhoto, gc);
-        
+
         gc.gridx = 0;
         gc.gridy = 2;
@@ -500,5 +500,5 @@
         gc.weightx = gc.weighty = 0.0;
         panelTf.add(new JLabel(tr("Update position for: ")), gc);
-        
+
         gc.gridx = 1;
         gc.gridy = 2;
@@ -510,5 +510,5 @@
         rbAllImg = new JRadioButton(tr("All images"));
         panelTf.add(rbAllImg, gc);
-        
+
         gc.gridx = 1;
         gc.gridy = 3;
@@ -520,5 +520,5 @@
         rbNoExifImg = new JRadioButton(tr("Images with no exif position"));
         panelTf.add(rbNoExifImg, gc);
-        
+
         gc.gridx = 1;
         gc.gridy = 4;
@@ -530,15 +530,15 @@
         rbUntaggedImg = new JRadioButton(tr("Not yet tagged images"));
         panelTf.add(rbUntaggedImg, gc);
-        
+
         ButtonGroup group = new ButtonGroup();
         group.add(rbAllImg);
         group.add(rbNoExifImg);
         group.add(rbUntaggedImg);
-        
+
         rbUntaggedImg.setSelected(true);
-        
+
         panel = new JPanel();
         panel.setLayout(new BorderLayout());
-        
+
         panel.add(panelCb, BorderLayout.PAGE_START);
         panel.add(panelTf, BorderLayout.CENTER);
@@ -555,5 +555,5 @@
 
             if (item == null || ! (item instanceof GpxDataWrapper)) {
-                JOptionPane.showMessageDialog(Main.parent, tr("You should select a GPX track"), 
+                JOptionPane.showMessageDialog(Main.parent, tr("You should select a GPX track"),
                                               tr("No selected GPX track"), JOptionPane.ERROR_MESSAGE );
                 continue;
@@ -563,10 +563,10 @@
             Float timezoneValue = parseTimezone(tfTimezone.getText().trim());
             if (timezoneValue == null) {
-                JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing timezone.\nExpected format: {0}", "+H:MM"), 
+                JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing timezone.\nExpected format: {0}", "+H:MM"),
                         tr("Invalid timezone"), JOptionPane.ERROR_MESSAGE);
                 continue;
             }
             gpstimezone = timezoneValue.floatValue();
-            
+
             String deltaText = tfOffset.getText().trim();
             if (deltaText.length() > 0) {
@@ -574,5 +574,5 @@
                     delta = Long.parseLong(deltaText);
                 } catch(NumberFormatException nfe) {
-                    JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing offset.\nExpected format: {0}", "number"), 
+                    JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing offset.\nExpected format: {0}", "number"),
                             tr("Invalid offset"), JOptionPane.ERROR_MESSAGE);
                     continue;
@@ -581,12 +581,12 @@
                 delta = 0;
             }
-            
+
             Main.pref.put("tagimages.doublegpstimezone", Double.toString(gpstimezone));
             Main.pref.put("tagimages.gpstimezone", Long.toString(- ((long) gpstimezone)));
             Main.pref.put("tagimages.delta", Long.toString(delta * 1000));
-            
+
             isOk = true;
         }
-        
+
         // Construct a list of images that have a date, and sort them on the date.
         ArrayList<ImageEntry> dateImgLst = new ArrayList<ImageEntry>(yLayer.data.size());
@@ -597,5 +597,5 @@
                 }
             }
-        
+
         } else if (rbNoExifImg.isSelected()) {
             for (ImageEntry e : yLayer.data) {
@@ -605,5 +605,5 @@
             }
 
-        } else { // rbUntaggedImg.isSelected()  
+        } else { // rbUntaggedImg.isSelected()
             for (ImageEntry e : yLayer.data) {
                 if (e.time != null && e.coor == null) {
@@ -612,12 +612,12 @@
             }
         }
-        
+
         int matched = matchGpxTrack(dateImgLst, selectedGpx.data, (long) (gpstimezone * 3600000) + delta * 1000);
 
-        // Search whether an other layer has yet defined some bounding box. 
+        // Search whether an other layer has yet defined some bounding box.
         // If none, we'll zoom to the bounding box of the layer with the photos.
         Collection<Layer> layerCol = Main.map.mapView.getAllLayers();
         Iterator<Layer> layerIter = layerCol.iterator();
-        boolean boundingBoxedLayerFound = false; 
+        boolean boundingBoxedLayerFound = false;
         while (layerIter.hasNext()) {
             Layer l = layerIter.next();
@@ -636,17 +636,17 @@
             Main.map.mapView.recalculateCenterScale(bbox);
         }
-        
+
         Main.main.map.repaint();
-        
+
         JOptionPane.showMessageDialog(Main.parent, tr("Found {0} matchs of {1} in GPX track {2}", matched, dateImgLst.size(), selectedGpx.name),
-                tr("GPX Track loaded"), 
-                ((dateImgLst.size() > 0 && matched == 0) ? JOptionPane.WARNING_MESSAGE 
+                tr("GPX Track loaded"),
+                ((dateImgLst.size() > 0 && matched == 0) ? JOptionPane.WARNING_MESSAGE
                                                          : JOptionPane.INFORMATION_MESSAGE));
-        
+
     }
 
     private int matchGpxTrack(ArrayList<ImageEntry> dateImgLst, GpxData selectedGpx, long offset) {
         int ret = 0;
-        
+
         Collections.sort(dateImgLst, new Comparator<ImageEntry>() {
             public int compare(ImageEntry arg0, ImageEntry arg1) {
@@ -654,22 +654,22 @@
             }
         });
-        
+
         PrimaryDateParser dateParser = new PrimaryDateParser();
-        
+
         for (GpxTrack trk : selectedGpx.tracks) {
             for (Collection<WayPoint> segment : trk.trackSegs) {
-                
+
                 long prevDateWp = 0;
                 WayPoint prevWp = null;
-                
+
                 for (WayPoint curWp : segment) {
-                
-                    String curDateWpStr = (String) curWp.attr.get("time"); 
+
+                    String curDateWpStr = (String) curWp.attr.get("time");
                     if (curDateWpStr != null) {
-                        
+
                         try {
                             long curDateWp = dateParser.parse(curDateWpStr).getTime() + offset;
                             ret += matchPoints(dateImgLst, prevWp, prevDateWp, curWp, curDateWp);
-                            
+
                             prevWp = curWp;
                             prevDateWp = curDateWp;
@@ -710,8 +710,8 @@
             } catch (Exception e) {
             }
-            
-            while(i >= 0 
+
+            while(i >= 0
                     && dateImgLst.get(i).time.getTime() == curDateWp) {
-                dateImgLst.get(i).pos = curWp.eastNorth; 
+                dateImgLst.get(i).pos = curWp.eastNorth;
                 dateImgLst.get(i).coor = Main.proj.eastNorth2latlon(dateImgLst.get(i).pos);
                 dateImgLst.get(i).speed = speed;
@@ -720,17 +720,17 @@
                 i--;
             }
-            
+
             if (prevDateWp != 0) {
                 long imgDate;
-                while(i >= 0 
+                while(i >= 0
                         && (imgDate = dateImgLst.get(i).time.getTime()) > prevDateWp) {
                     dateImgLst.get(i).pos = new EastNorth(
                             prevWp.eastNorth.east() + ((curWp.eastNorth.east() - prevWp.eastNorth.east()) * (imgDate - prevDateWp)) / (curDateWp - prevDateWp),
-                            prevWp.eastNorth.north() + ((curWp.eastNorth.north() - prevWp.eastNorth.north()) * (imgDate - prevDateWp)) / (curDateWp - prevDateWp)); 
+                            prevWp.eastNorth.north() + ((curWp.eastNorth.north() - prevWp.eastNorth.north()) * (imgDate - prevDateWp)) / (curDateWp - prevDateWp));
                     dateImgLst.get(i).coor = Main.proj.eastNorth2latlon(dateImgLst.get(i).pos);
                     dateImgLst.get(i).speed = speed;
                     if (curElevation != null && prevElevation != null) {
                         dateImgLst.get(i).elevation = prevElevation + ((curElevation - prevElevation) * (imgDate - prevDateWp)) / (curDateWp - prevDateWp);
-                    } 
+                    }
                     ret++;
                     i--;
@@ -757,5 +757,5 @@
             return curIndex;
         }
-        
+
         int curIndex = 0;
         int startIndex=0;
@@ -782,5 +782,5 @@
     private String formatTimezone(double timezone) {
         StringBuffer ret = new StringBuffer();
-        
+
         if (timezone < 0) {
             ret.append('-');
@@ -795,13 +795,13 @@
         }
         ret.append(minutes);
-        
+
         return ret.toString();
     }
-    
+
     private Float parseTimezone(String timezone) {
-    	if (timezone.length() == 0) {
-    		return new Float(0);
-    	}
-    	
+        if (timezone.length() == 0) {
+            return new Float(0);
+        }
+
         char sgnTimezone = '+';
         StringBuffer hTimezone = new StringBuffer();
@@ -817,5 +817,5 @@
                 break;
             case '+' :
-            case '-' : 
+            case '-' :
                 if (state == 1) {
                     sgnTimezone = c;
@@ -825,6 +825,6 @@
                 }
                 break;
-            case ':' : 
-            case '.' : 
+            case ':' :
+            case '.' :
                 if (state == 2) {
                     state = 3;
@@ -833,54 +833,54 @@
                 }
                 break;
-            case '0' : case '1' : case '2' : case '3' : case '4' : 
+            case '0' : case '1' : case '2' : case '3' : case '4' :
             case '5' : case '6' : case '7' : case '8' : case '9' :
                 switch(state) {
-                case 1 : 
-                case 2 : 
+                case 1 :
+                case 2 :
                     state = 2;
                     hTimezone.append(c);
                     break;
-                case 3 : 
+                case 3 :
                     mTimezone.append(c);
                     break;
-                default : 
+                default :
                     return null;
                 }
                 break;
-            default : 
+            default :
                 return null;
             }
         }
-        
+
         int h = 0;
         int m = 0;
         try {
-       		h = Integer.parseInt(hTimezone.toString());
-        	if (mTimezone.length() > 0) {
-        		m = Integer.parseInt(mTimezone.toString());
-        	}
+            h = Integer.parseInt(hTimezone.toString());
+            if (mTimezone.length() > 0) {
+                m = Integer.parseInt(mTimezone.toString());
+            }
         } catch (NumberFormatException nfe) {
-        	// Invalid timezone
-        	return null;
-        }
-        
+            // Invalid timezone
+            return null;
+        }
+
         if (h > 12 || m > 59 ) {
             return null;
         } else {
-        	return new Float((h + m / 60.0) * (sgnTimezone == '-' ? -1 : 1));
-        }
-    }
-
-    /** Return the distance in meters between 2 points 
+            return new Float((h + m / 60.0) * (sgnTimezone == '-' ? -1 : 1));
+        }
+    }
+
+    /** Return the distance in meters between 2 points
      * Formula and earth radius from : http://en.wikipedia.org/wiki/Great-circle_distance */
     public double getDistance(WayPoint p1, WayPoint p2) {
         double p1Lat = p1.latlon.lat() * Math.PI / 180;
-        double p1Lon = p1.latlon.lon() * Math.PI / 180; 
+        double p1Lon = p1.latlon.lon() * Math.PI / 180;
         double p2Lat = p2.latlon.lat() * Math.PI / 180;
         double p2Lon = p2.latlon.lon() * Math.PI / 180;
-        double ret = Math.atan2(Math.sqrt(Math.pow(Math.cos(p2Lat) * Math.sin(p2Lon - p1Lon), 2) 
+        double ret = Math.atan2(Math.sqrt(Math.pow(Math.cos(p2Lat) * Math.sin(p2Lon - p1Lon), 2)
                                           + Math.pow(Math.cos(p1Lat) * Math.sin(p2Lat)
-                                                     - Math.sin(p1Lat) * Math.cos(p2Lat) * Math.cos(p2Lon - p1Lon), 2)), 
-                                Math.sin(p1Lat) * Math.sin(p2Lat) 
+                                                     - Math.sin(p1Lat) * Math.cos(p2Lat) * Math.cos(p2Lon - p1Lon), 2)),
+                                Math.sin(p1Lat) * Math.sin(p2Lat)
                                 + Math.cos(p1Lat) * Math.cos(p2Lat) * Math.cos(p2Lon - p1Lon))
                      * 6372795; // Earth radius, in meters
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/ImageDisplay.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/ImageDisplay.java	(revision 12747)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/ImageDisplay.java	(revision 12778)
@@ -25,18 +25,18 @@
 
 public class ImageDisplay extends JComponent {
-    
+
     /** The file that is currently displayed */
     private File file = null;
-    
+
     /** The image currently displayed */
     private Image image = null;
-    
+
     /** The image currently displayed */
     private boolean errorLoading = false;
-    
-    /** The rectangle (in image coordinates) of the image that is visible. This rectangle is calculated 
+
+    /** The rectangle (in image coordinates) of the image that is visible. This rectangle is calculated
      * each time the zoom is modified */
     private Rectangle visibleRect = null;
-    
+
     /** When a selection is done, the rectangle of the selection (in image coordinates) */
     private Rectangle selectedRect = null;
@@ -46,22 +46,22 @@
 
     private String osdText = null;
-    
+
     /** The thread that reads the images. */
     private class LoadImageRunnable implements Runnable {
 
         File file = null;
-        
+
         public LoadImageRunnable(File file) {
             this.file = file;
         }
-        
+
         public void run() {
             Image img = Toolkit.getDefaultToolkit().createImage(file.getPath());
             tracker.addImage(img, 1);
-            
+
             // Wait for the end of loading
             while (! tracker.checkID(1, true)) {
                 if (this.file != ImageDisplay.this.file) {
-                    // The file has changed 
+                    // The file has changed
                     tracker.removeImage(img);
                     return;
@@ -77,8 +77,8 @@
                 error = true;
             }
-            
+
             synchronized(ImageDisplay.this) {
                 if (this.file != ImageDisplay.this.file) {
-                    // The file has changed 
+                    // The file has changed
                     tracker.removeImage(img);
                     return;
@@ -93,17 +93,17 @@
         }
     }
-    
+
     private class ImgDisplayMouseListener implements MouseListener, MouseWheelListener, MouseMotionListener {
 
         boolean mouseIsDragging = false;
         Point mousePointInImg = null;
-        
-        /** Zoom in and out, trying to preserve the point of the image that was under the mouse cursor 
-         * at the same place */ 
+
+        /** Zoom in and out, trying to preserve the point of the image that was under the mouse cursor
+         * at the same place */
         public void mouseWheelMoved(MouseWheelEvent e) {
             File file;
             Image image;
             Rectangle visibleRect;
-            
+
             synchronized (ImageDisplay.this) {
                 file = ImageDisplay.this.file;
@@ -111,18 +111,18 @@
                 visibleRect = ImageDisplay.this.visibleRect;
             }
-            
+
             mouseIsDragging = false;
             selectedRect = null;
-            
+
             if (image == null) {
                 return;
             }
 
-            // Calculate the mouse cursor position in image coordinates, so that we can center the zoom 
-            // on that mouse position. 
+            // Calculate the mouse cursor position in image coordinates, so that we can center the zoom
+            // on that mouse position.
             if (e.getClickCount() == 1 || mousePointInImg == null) {
                 mousePointInImg = comp2imgCoord(visibleRect, e.getX(), e.getY());
             }
-            
+
             // Applicate the zoom to the visible rectangle in image coordinates
             if (e.getWheelRotation() > 0) {
@@ -133,5 +133,5 @@
                 visibleRect.height = visibleRect.height * 2 / 3;
             }
-            
+
             // Check that the zoom doesn't exceed 2:1
             if (visibleRect.width < getSize().width / 2) {
@@ -141,5 +141,5 @@
                 visibleRect.height = getSize().height / 2;
             }
-            
+
             // Set the same ratio for the visible rectangle and the display area
             int hFact = visibleRect.height * getSize().width;
@@ -150,16 +150,16 @@
                 visibleRect.height = wFact / getSize().width;
             }
-            
+
             // The size of the visible rectangle is limited by the image size.
             checkVisibleRectSize(image, visibleRect);
-            
+
             // Set the position of the visible rectangle, so that the mouse cursor doesn't move on the image.
             Rectangle drawRect = calculateDrawImageRectangle(visibleRect);
             visibleRect.x = mousePointInImg.x + ((drawRect.x - e.getX()) * visibleRect.width) / drawRect.width;
             visibleRect.y = mousePointInImg.y + ((drawRect.y - e.getY()) * visibleRect.height) / drawRect.height;
-            
+
             // The position is also limited by the image size
             checkVisibleRectPos(image, visibleRect);
-            
+
             synchronized(ImageDisplay.this) {
                 if (ImageDisplay.this.file == file) {
@@ -176,5 +176,5 @@
             Image image;
             Rectangle visibleRect;
-            
+
             synchronized (ImageDisplay.this) {
                 file = ImageDisplay.this.file;
@@ -190,14 +190,14 @@
                 return;
             }
-            
+
             // Calculate the translation to set the clicked point the center of the view.
             Point click = comp2imgCoord(visibleRect, e.getX(), e.getY());
             Point center = getCenterImgCoord(visibleRect);
-            
+
             visibleRect.x += click.x - center.x;
             visibleRect.y += click.y - center.y;
-            
+
             checkVisibleRectPos(image, visibleRect);
-            
+
             synchronized(ImageDisplay.this) {
                 if (ImageDisplay.this.file == file) {
@@ -208,5 +208,5 @@
         }
 
-        /** Initialize the dragging, either with button 1 (simple dragging) or button 3 (selection of 
+        /** Initialize the dragging, either with button 1 (simple dragging) or button 3 (selection of
          * a picture part) */
         public void mousePressed(MouseEvent e) {
@@ -216,9 +216,9 @@
                 return;
             }
-            
+
             File file;
             Image image;
             Rectangle visibleRect;
-            
+
             synchronized (ImageDisplay.this) {
                 file = ImageDisplay.this.file;
@@ -251,9 +251,9 @@
                 return;
             }
-            
+
             File file;
             Image image;
             Rectangle visibleRect;
-            
+
             synchronized (ImageDisplay.this) {
                 file = ImageDisplay.this.file;
@@ -279,5 +279,5 @@
                 }
                 ImageDisplay.this.repaint();
-                
+
             } else if (selectedRect != null) {
                 Point p = comp2imgCoord(visibleRect, e.getX(), e.getY());
@@ -300,9 +300,9 @@
                 return;
             }
-            
+
             File file;
             Image image;
             Rectangle visibleRect;
-            
+
             synchronized (ImageDisplay.this) {
                 file = ImageDisplay.this.file;
@@ -319,5 +319,5 @@
             if (mouseIsDragging) {
                 mouseIsDragging = false;
-                
+
             } else if (selectedRect != null) {
                 int oldWidth = selectedRect.width;
@@ -331,5 +331,5 @@
                     selectedRect.height = getSize().height / 2;
                 }
-                
+
                 // Set the same ratio for the visible rectangle and the display area
                 int hFact = selectedRect.height * getSize().width;
@@ -340,5 +340,5 @@
                     selectedRect.height = wFact / getSize().width;
                 }
-                
+
                 // Keep the center of the selection
                 if (selectedRect.width != oldWidth) {
@@ -348,13 +348,13 @@
                     selectedRect.y -= (selectedRect.height - oldHeight) / 2;
                 }
-                
+
                 checkVisibleRectSize(image, selectedRect);
                 checkVisibleRectPos(image, selectedRect);
-                
+
                 synchronized (ImageDisplay.this) {
                     if (file == ImageDisplay.this.file) {
                         ImageDisplay.this.visibleRect = selectedRect;
                     }
-                }                
+                }
                 selectedRect = null;
                 ImageDisplay.this.repaint();
@@ -370,5 +370,5 @@
         public void mouseMoved(MouseEvent e) {
         }
-        
+
         private void checkPointInVisibleRect(Point p, Rectangle visibleRect) {
             if (p.x < visibleRect.x) {
@@ -386,5 +386,5 @@
         }
     }
-    
+
     public ImageDisplay() {
         ImgDisplayMouseListener mouseListener = new ImgDisplayMouseListener();
@@ -393,5 +393,5 @@
         addMouseMotionListener(mouseListener);
     }
-    
+
     public void setImage(File file) {
         synchronized(this) {
@@ -410,5 +410,5 @@
         this.osdText = text;
     }
-    
+
     public void paintComponent(Graphics g) {
         Image image;
@@ -416,5 +416,5 @@
         Rectangle visibleRect;
         boolean errorLoading;
-        
+
         synchronized(this) {
             image = this.image;
@@ -423,5 +423,5 @@
             errorLoading = this.errorLoading;
         }
-        
+
         if (file == null) {
             g.setColor(Color.black);
@@ -447,12 +447,12 @@
         } else {
             Rectangle target = calculateDrawImageRectangle(visibleRect);
-            g.drawImage(image, 
-                        target.x, target.y, target.x + target.width, target.y + target.height, 
-                        visibleRect.x, visibleRect.y, visibleRect.x + visibleRect.width, visibleRect.y + visibleRect.height, 
+            g.drawImage(image,
+                        target.x, target.y, target.x + target.width, target.y + target.height,
+                        visibleRect.x, visibleRect.y, visibleRect.x + visibleRect.width, visibleRect.y + visibleRect.height,
                         null);
             if (selectedRect != null) {
                 Point topLeft = img2compCoord(visibleRect, selectedRect.x, selectedRect.y);
-                Point bottomRight = img2compCoord(visibleRect, 
-                                                  selectedRect.x + selectedRect.width, 
+                Point bottomRight = img2compCoord(visibleRect,
+                                                  selectedRect.x + selectedRect.width,
                                                   selectedRect.y + selectedRect.height);
                 g.setColor(new Color(128, 128, 128, 180));
@@ -502,5 +502,5 @@
         }
     }
-    
+
     private final Point img2compCoord(Rectangle visibleRect, int xImg, int yImg) {
         Rectangle drawRect = calculateDrawImageRectangle(visibleRect);
@@ -524,8 +524,8 @@
         int x, y, w, h;
         x = 0;
-        y = 0; 
+        y = 0;
         w = size.width;
         h = size.height;
-        
+
         int wFact = w * visibleRect.height;
         int hFact = h * visibleRect.width;
@@ -546,5 +546,5 @@
         Image image;
         Rectangle visibleRect;
-        
+
         synchronized (this) {
             file = ImageDisplay.this.file;
@@ -560,13 +560,13 @@
             // The display is not at best fit. => Zoom to best fit
             visibleRect = new Rectangle(0, 0, image.getWidth(null), image.getHeight(null));
-        
+
         } else {
             // The display is at best fit => zoom to 1:1
             Point center = getCenterImgCoord(visibleRect);
-            visibleRect = new Rectangle(center.x - getWidth() / 2, center.y - getHeight() / 2, 
+            visibleRect = new Rectangle(center.x - getWidth() / 2, center.y - getHeight() / 2,
                                         getWidth(), getHeight());
             checkVisibleRectPos(image, visibleRect);
         }
-        
+
         synchronized(this) {
             if (file == this.file) {
