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 12739)
+++ /applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 12740)
@@ -578,10 +578,15 @@
             gpstimezone = timezoneValue.floatValue();
             
-            try {
-                delta = Long.parseLong(tfOffset.getText());
-            } catch(NumberFormatException nfe) {
-                JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing offset.\nExpected format: {0}", "number"), 
-                        tr("Invalid offset"), JOptionPane.ERROR_MESSAGE);
-                continue;
+            String deltaText = tfOffset.getText().trim();
+            if (deltaText.length() > 0) {
+                try {
+                    delta = Long.parseLong(deltaText);
+                } catch(NumberFormatException nfe) {
+                    JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing offset.\nExpected format: {0}", "number"), 
+                            tr("Invalid offset"), JOptionPane.ERROR_MESSAGE);
+                    continue;
+                }
+            } else {
+                delta = 0;
             }
             
@@ -804,7 +809,11 @@
     
     private Float parseTimezone(String timezone) {
+    	if (timezone.length() == 0) {
+    		return new Float(0);
+    	}
+    	
         char sgnTimezone = '+';
-        String hTimezone = "";
-        String mTimezone = "";
+        StringBuffer hTimezone = new StringBuffer();
+        StringBuffer mTimezone = new StringBuffer();
         int state = 1; // 1=start/sign, 2=hours, 3=minutes.
         for (int i = 0; i < timezone.length(); i++) {
@@ -837,12 +846,10 @@
                 switch(state) {
                 case 1 : 
+                case 2 : 
                     state = 2;
-                    hTimezone += c;
-                    break;
-                case 2 : 
-                    hTimezone += c;
+                    hTimezone.append(c);
                     break;
                 case 3 : 
-                    mTimezone += c;
+                    mTimezone.append(c);
                     break;
                 default : 
@@ -854,10 +861,22 @@
             }
         }
-        int h = Integer.parseInt(hTimezone);
-        int m = Integer.parseInt(mTimezone);
+        
+        int h = 0;
+        int m = 0;
+        try {
+       		h = Integer.parseInt(hTimezone.toString());
+        	if (mTimezone.length() > 0) {
+        		m = Integer.parseInt(mTimezone.toString());
+        	}
+        } catch (NumberFormatException nfe) {
+        	// Invalid timezone
+        	return null;
+        }
+        
         if (h > 12 || m > 59 ) {
             return null;
-        }
-        return new Float((h + m / 60.0) * (sgnTimezone == '-' ? -1 : 1));
+        } else {
+        	return new Float((h + m / 60.0) * (sgnTimezone == '-' ? -1 : 1));
+        }
     }
 
