Index: /applications/editors/josm/plugins/ImportImagePlugin/.classpath
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/.classpath	(revision 31745)
+++ /applications/editors/josm/plugins/ImportImagePlugin/.classpath	(revision 31746)
@@ -2,4 +2,5 @@
 <classpath>
 	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="test/unit"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
@@ -7,4 +8,5 @@
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM-jts"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM-log4j"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: /applications/editors/josm/plugins/ImportImagePlugin/.settings/org.eclipse.core.resources.prefs
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/.settings/org.eclipse.core.resources.prefs	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/.settings/org.eclipse.core.resources.prefs	(revision 31746)
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//test/report=UTF-8
Index: /applications/editors/josm/plugins/ImportImagePlugin/build.xml
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/build.xml	(revision 31745)
+++ /applications/editors/josm/plugins/ImportImagePlugin/build.xml	(revision 31746)
@@ -17,28 +17,9 @@
     <import file="../build-common.xml"/>
 
-	<!--
-    **********************************************************
-    ** compile - complies the source tree
-    **********************************************************
-    -->
-	<target name="compile" depends="init">
-		<echo message="compiling sources for  ${plugin.jar} ... "/>
-		<javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}" includeantruntime="false">
-            <classpath>
-                <pathelement location="${josm}"/>
-                <fileset dir="../log4j/lib">
-                    <include name="**/*.jar"/>
-                </fileset>
-                <fileset dir="../jts/lib">
-                    <include name="**/*.jar"/>
-                </fileset>
-                <fileset dir="../geotools/lib">
-                    <include name="**/*.jar"/>
-                </fileset>
-            </classpath>
-			<compilerarg value="-Xlint:deprecation"/>
-			<compilerarg value="-Xlint:unchecked"/>
-		</javac>
-	</target>
-	
+	<fileset id="plugin.requires.jars" dir="${plugin.dist.dir}">
+        <include name="log4j.jar"/>
+        <include name="jts.jar"/>
+        <include name="geotools.jar"/>
+    </fileset>
+
 </project>
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 31745)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 31746)
@@ -111,5 +111,5 @@
                 if (val == 3) {
                     logger.debug("No projection and user declined un-projected use");
-                    throw new LayerCreationCancledException();
+                    throw new LayerCreationCanceledException();
                 }
                 CoordinateReferenceSystem src = null;
@@ -327,13 +327,10 @@
             layerProps.setVisible(true);
         }
-
-    }
-
-    /**
-     * Exception which represents that the layer creation has been cancled by the
-     * user.
-     *
-     */
-    class LayerCreationCancledException extends IOException{
+    }
+
+    /**
+     * Exception which represents that the layer creation has been canceled by the user.
+     */
+    class LayerCreationCanceledException extends IOException{
     }
 
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java	(revision 31745)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java	(revision 31746)
@@ -14,5 +14,5 @@
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.FileImporter;
-import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCancledException;
+import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException;
 
 /**
@@ -47,5 +47,5 @@
             try {
                 layer = new ImageLayer(file);
-            } catch (LayerCreationCancledException e) {
+            } catch (LayerCreationCanceledException e) {
             // if user decides that layer should not be created just return.
                 continue;
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java	(revision 31745)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java	(revision 31746)
@@ -91,10 +91,11 @@
             loadFileAction = new LoadImageAction();
             loadFileAction.setEnabled(true);
-            MainMenu.add(Main.main.menu.imagerySubMenu, loadFileAction);
-
-            // add menu entries
-            //Main.main.menu.fileMenu.insert(loadFileAction, 8);
-
-            //Main.main.menu.fileMenu.insertSeparator(9);
+            if (Main.main != null) {
+                MainMenu.add(Main.main.menu.imagerySubMenu, loadFileAction);
+    
+                // add menu entries
+                //Main.main.menu.fileMenu.insert(loadFileAction, 8);
+                //Main.main.menu.fileMenu.insertSeparator(9);
+            }
 
             ExtensionFileFilter.importers.add(new ImportImageFileImporter());
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(revision 31745)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(revision 31746)
@@ -12,5 +12,5 @@
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
-import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCancledException;
+import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException;
 
 
@@ -46,5 +46,5 @@
             try {
                 layer = new ImageLayer(fc.getSelectedFile());
-            } catch (LayerCreationCancledException e) {
+            } catch (LayerCreationCanceledException e) {
                 // if user decides that layer should not be created just return.
                 return;
Index: /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 31745)
+++ /applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 31746)
@@ -154,4 +154,7 @@
 
             BufferedImage img = ImageIO.read(file);
+            if (img == null) {
+                throw new IOException("Cannot read image file " + file.getAbsolutePath());
+            }
 
             // create Envelope
@@ -336,12 +339,11 @@
     {
         GridCoverage2D coverage = null;
-        Hints hints = new Hints();
+        Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, true);
         if(refSys != null)
         {
             hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, refSys);
-
-        }
-        // dont't use the EPSG-Factory because of wrong behaviour
-        hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true));
+        }
+        // don't use the EPSG-Factory because of wrong behaviour
+        //hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true));
 
         GeoTiffReader reader = new GeoTiffReader(file, hints);
@@ -352,7 +354,6 @@
     }
 
-
-    /**
-     * Loads CRS data from an EPSG database and creates descrptions for each one.
+    /**
+     * Loads CRS data from an EPSG database and creates descriptions for each one.
      *
      * @param pluginProps
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/README
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/README	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/README	(revision 31746)
@@ -0,0 +1,23 @@
+		GeoTIFF Samples
+		===============
+
+The following directories contain GeoTIFF samples from a variety of
+sources.  Just because a file is in this tree does not imply that
+it follows the standard correctly, or should be considered an 
+example of good practice.  However, a reader that aims for flexibility
+would be well advised to try and handle virtually all these files
+gracefully. 
+
+Most of the TIFF files have an .lgo file associated with them.  This
+is the output of listgeo for that file.  This includes the normalized
+form of the underlying projection and when possible the corners
+reprojected into lat/long.  The reprojection output of listgeo should
+not be considered authoritative.  If you believe that the reprojected
+results for any of the files is wrong, please contact me.  
+
+Over time I intend to prepare a set of samples which can be considered
+``best practice'', and which can be used as authoritative examples. 
+Any assistance in this task would be appreciated.
+
+If you have additional samples you would like to submit to this archive
+please contact me at warmerda@home.com (or warmerda@remotesensing.org).
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/README.txt
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/README.txt	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/README.txt	(revision 31746)
@@ -0,0 +1,42 @@
+The following images are GeoTIFF samples.  These are SPOT Imagery
+data of downtown Chicago, IL (USA) at 10 meter resolution.  
+There are two GeoTIFF images as follows:
+
+SP27GTIF TIF   652094  bytes  
+UTM2GTIF TIF   650463  bytes 
+
+One is in State Plane NAD 1927 projected coordinate systems.
+The Other is in Universal Transverse Mercator proj coord system.
+
+These were constructed using the following GeoTIFF parser metadata files:
+
+SP27GTIF TXT      732  bytes
+UTM2GTIF TXT      729  bytes
+
+These TXT files are in the format compliant with Niles Ritter's
+"LibGeoTIFF" parsing software. 
+
+For your reference, I included two of the SPOT "GeoSPOT" format 
+header files to provide more information about these images. 
+This is all ASCII readable and provided just for reference, in
+case you need to see what we intended the GeoTIFF images to contain.
+
+These images have been enhanced by contrast optimization and a light
+Laplace spatial filter.  So, you should be able to see them immediately
+without further processing, in your display environment.  If you can't
+see them right away, it's not because they need stretching or brightening
+but probably there is a problem with the display software. 
+
+Please contact me if you have questions about these images or
+their attributes.   My name is Mike Ruth, and the following 
+contact information may be used:
+
+-------------
+Mike Ruth  [ruth@palv.spot.com]
+SPOT Image Corporation
+Manager, Product Development
+voice: 703) 715-3146
+fax: 703) 648-1813
+------------
+
+Thanks for your interest in GeoTIFF.      ... 6 OCT 95
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.hdr
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.hdr	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.hdr	(revision 31746)
@@ -0,0 +1,43 @@
+!
+!    GIS-GEOSPOT Header File
+!
+!    Image Information
+!
+DELTA_X_ORIGIN       0.0 FT
+DELTA_Y_ORIGIN       0.0 FT
+MAPUNITS             FEET
+ULXMAP               681451.44 FT
+ULYMAP               1913050.20 FT
+XDIM                 32.8 FT
+YDIM                 32.8 FT
+NCOLS                700
+NROWS                930
+NBANDS               1
+!
+!    Frame Corner Support
+!
+NW_X_PIXEL           1
+NW_Y_PIXEL           6
+NE_X_PIXEL           692
+NE_Y_PIXEL           1
+SW_X_PIXEL           8
+SW_Y_PIXEL           930
+SE_X_PIXEL           700
+SE_Y_PIXEL           926
+!
+!    File Encoding
+!
+NBITS                8
+BYTEORDER            I
+SKIPBYTES            0
+RECORDSKIPBYTES      0
+BANDROWBYTES         700
+TOTALROWBYTES        700
+LAYOUT               BIL
+BAND_RGB             1 1 1
+!
+!    Process Information
+!
+PRE_PROCESSING_LEVEL "2b"
+!
+! End of File
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.rep
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.rep	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.rep	(revision 31746)
@@ -0,0 +1,91 @@
+!
+!    GIS-GEOSPOT Report File
+!
+!    Product Identification
+!
+MAP_NUMBER           "St27pan5"
+PRODUCTION_DATE      1995-09-06
+MAP_NAME             "Chicago Loop"
+LOCATION             "Chicago, IL"
+!
+!    Geospot Structure
+!
+GEOSPOT_N_FILES      8
+!
+FILE_NAME_001        SPCS27.REP
+FILE_FORMAT_001      GEOSPOT 4.0
+FILE_THEME_001       "Geospot report file"
+!
+FILE_NAME_002        COPYRITE.T01
+FILE_FORMAT_002      TEXT 1.0
+FILE_THEME_002       "Copyright file"
+!
+FILE_NAME_003        SPCS27.HDR
+FILE_FORMAT_003      GEOSPOT 4.0
+FILE_THEME_003       "Image header file"
+!
+FILE_NAME_004        SPCS27.BIL
+FILE_FORMAT_004      GEOSPOT 4.0
+FILE_THEME_004       "Image file"
+!
+FILE_NAME_005        SPCS27.STX
+FILE_FORMAT_005      GEOSPOT 4.0
+FILE_THEME_005       "Image statistics file"
+!
+FILE_NAME_006        SPCS27.CLR
+FILE_FORMAT_006      GEOSPOT 4.0
+FILE_THEME_006       "Image palette file"
+!
+FILE_NAME_007        SPCS27.RSC
+FILE_FORMAT_007      GEOSPOT 4.0
+FILE_THEME_007       "Image source file"
+!
+FILE_NAME_008        QCK_LOOK.TIF
+FILE_FORMAT_008      TIFF 6.0
+FILE_THEME_008       "Quick-look file"
+!
+!
+!    Cartographic Parameters
+!
+PROJ_ID              "State Plane Coordinate System 1927"
+PROJ_ZONE            1201
+PROJ_CODE            2   USGS
+HORIZ_DATUM          "North American 1927"
+SPHEROID_NAME        "Clarke 1866"
+SPHEROID_MAJ_AXIS    6378206.4 M
+SPHEROID_FLAT        294.9786982
+!
+!    Framing Information
+!
+SHEET_RECT_TYPE      SINGLE
+SHEET_RECT_ELEVATION 50.0 M
+EASTING_SIZE         0.083333 DEG
+NORTHING_SIZE        0.083333 DEG
+NW_LON               -87.666667 DEG
+NW_LAT               41.916667 DEG
+NE_LON               -87.583333 DEG
+NE_LAT               41.916667 DEG
+SW_LON               -87.666667 DEG
+SW_LAT               41.833333 DEG
+SE_LON               -87.583333 DEG
+SE_LAT               41.833333 DEG
+NW_X_COORD           681451.53 FT
+NW_Y_COORD           1912895.78 FT
+NE_X_COORD           704132.98 FT
+NE_Y_COORD           1913083.12 FT
+SW_X_COORD           681687.39 FT
+SW_Y_COORD           1882529.60 FT
+SE_X_COORD           704398.33 FT
+SE_Y_COORD           1882716.88 FT
+GRID_DECLINATION     -0.4728 DEG
+!
+!    Raster Frame Information
+!
+PIXEL_ROTATION_SIN   0.0
+PIXEL_ROTATION_COS   1.0
+RASTER_X_ORIGIN      681451.44 FT
+RASTER_Y_ORIGIN      1913050.20 FT
+RASTER_X_SIZE        22965.6 FT
+RASTER_Y_SIZE        30511.4 FT
+!
+! End of File
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.tif.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.tif.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.tif.lgo	(revision 31746)
@@ -0,0 +1,38 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.2
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         681480           1913050          0                
+      ModelPixelScaleTag (1,3):
+         32.8             32.8             0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      GTCitationGeoKey (Ascii,24): "State Plane NAD27, Feet"
+      GeogCitationGeoKey (Ascii,23): "NAD27 in Feet default""
+      ProjectedCSTypeGeoKey (Short,1): PCS_NAD27_Illinois_East
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 26771 (NAD27 / Illinois East)
+Projection = 11201 (Illinois CS27 East zone)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 36.666667 ( 36d40' 0.00"N)
+   ProjNatOriginLongGeoKey: -88.333333 ( 88d20' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999975
+   ProjFalseEastingGeoKey: 152400.304801
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4267/NAD27
+Datum: 6267/North American Datum 1927
+Ellipsoid: 7008/Clarke 1866 (6378206.40,6356583.80)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9003/US survey foot (0.304801m)
+
+Corner Coordinates:
+Upper Left    ( 681480.000,1913050.000)  ( 87d39'59.59"W, 41d55' 1.56"N)
+Lower Left    ( 681480.000,1882578.800)  ( 87d40' 2.72"W, 41d50' 0.54"N)
+Upper Right   ( 704407.200,1913050.000)  ( 87d34'56.36"W, 41d54'59.69"N)
+Lower Right   ( 704407.200,1882578.800)  ( 87d34'59.88"W, 41d49'58.67"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.txt
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.txt	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/SP27GTIF.txt	(revision 31746)
@@ -0,0 +1,18 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 1.0
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                  0                  0                  
+         681480             1913050            0                  
+      ModelPixelScaleTag (1,3):
+         32.8               32.8               0                  
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      GTCitationGeoKey (Ascii,24): "State Plane NAD27, Feet"
+      GeogCitationGeoKey (Ascii,24): "NAD27 in Feet default"
+      ProjectedCSTypeGeoKey (Short,1): PCS_NAD27_Illinois_East
+      End_Of_Keys.
+   End_Of_Geotiff.
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.hdr
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.hdr	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.hdr	(revision 31746)
@@ -0,0 +1,43 @@
+!
+!    GIS-GEOSPOT Header File
+!
+!    Image Information
+!
+DELTA_X_ORIGIN       0.0 M
+DELTA_Y_ORIGIN       0.0 M
+MAPUNITS             METERS
+ULXMAP               444642.80 M
+ULYMAP               4640515.00 M
+XDIM                 10.0 M
+YDIM                 10.0 M
+NCOLS                699
+NROWS                929
+NBANDS               1
+!
+!    Frame Corner Support
+!
+NW_X_PIXEL           8
+NW_Y_PIXEL           1
+NE_X_PIXEL           699
+NE_Y_PIXEL           5
+SW_X_PIXEL           1
+SW_Y_PIXEL           925
+SE_X_PIXEL           693
+SE_Y_PIXEL           929
+!
+!    File Encoding
+!
+NBITS                8
+BYTEORDER            I
+SKIPBYTES            0
+RECORDSKIPBYTES      0
+BANDROWBYTES         699
+TOTALROWBYTES        699
+LAYOUT               BIL
+BAND_RGB             1 1 1
+!
+!    Process Information
+!
+PRE_PROCESSING_LEVEL "3a"
+!
+! End of File
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.rep
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.rep	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.rep	(revision 31746)
@@ -0,0 +1,91 @@
+!
+!    GIS-GEOSPOT Report File
+!
+!    Product Identification
+!
+MAP_NUMBER           "UTM27pan5"
+PRODUCTION_DATE      1995-09-06
+MAP_NAME             "Chicago Loop"
+LOCATION             "Chicago, IL"
+!
+!    Geospot Structure
+!
+GEOSPOT_N_FILES      8
+!
+FILE_NAME_001        UTM27.REP
+FILE_FORMAT_001      GEOSPOT 4.0
+FILE_THEME_001       "Geospot report file"
+!
+FILE_NAME_002        COPYRITE.T01
+FILE_FORMAT_002      TEXT 1.0
+FILE_THEME_002       "Copyright file"
+!
+FILE_NAME_003        UTM27.HDR
+FILE_FORMAT_003      GEOSPOT 4.0
+FILE_THEME_003       "Image header file"
+!
+FILE_NAME_004        UTM27.BIL
+FILE_FORMAT_004      GEOSPOT 4.0
+FILE_THEME_004       "Image file"
+!
+FILE_NAME_005        UTM27.STX
+FILE_FORMAT_005      GEOSPOT 4.0
+FILE_THEME_005       "Image statistics file"
+!
+FILE_NAME_006        UTM27.CLR
+FILE_FORMAT_006      GEOSPOT 4.0
+FILE_THEME_006       "Image palette file"
+!
+FILE_NAME_007        UTM27.RSC
+FILE_FORMAT_007      GEOSPOT 4.0
+FILE_THEME_007       "Image source file"
+!
+FILE_NAME_008        QCK_LOOK.TIF
+FILE_FORMAT_008      TIFF 6.0
+FILE_THEME_008       "Quick-look file"
+!
+!
+!    Cartographic Parameters
+!
+PROJ_ID              "Universal Transverse Mercator"
+PROJ_ZONE            16
+PROJ_CODE            1   USGS
+HORIZ_DATUM          "North American 1927"
+SPHEROID_NAME        "Clarke 1866"
+SPHEROID_MAJ_AXIS    6378206.4 M
+SPHEROID_FLAT        294.9786982
+!
+!    Framing Information
+!
+SHEET_RECT_TYPE      SINGLE
+SHEET_RECT_ELEVATION 50.0 M
+EASTING_SIZE         0.083333 DEG
+NORTHING_SIZE        0.083333 DEG
+NW_LON               -87.666667 DEG
+NW_LAT               41.916667 DEG
+NE_LON               -87.583333 DEG
+NE_LAT               41.916667 DEG
+SW_LON               -87.666667 DEG
+SW_LAT               41.833333 DEG
+SE_LON               -87.583333 DEG
+SE_LAT               41.833333 DEG
+NW_X_COORD           444714.62 M
+NW_Y_COORD           4640525.34 M
+NE_X_COORD           451625.32 M
+NE_Y_COORD           4640474.98 M
+SW_X_COORD           444642.75 M
+SW_Y_COORD           4631273.20 M
+SE_X_COORD           451562.44 M
+SE_Y_COORD           4631222.86 M
+GRID_DECLINATION     0.4172 DEG
+!
+!    Raster Frame Information
+!
+PIXEL_ROTATION_SIN   0.0
+PIXEL_ROTATION_COS   1.0
+RASTER_X_ORIGIN      444642.80 M
+RASTER_Y_ORIGIN      4640515.00 M
+RASTER_X_SIZE        6990.0 M
+RASTER_Y_SIZE        9290.0 M
+!
+! End of File
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.tif.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.tif.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.tif.lgo	(revision 31746)
@@ -0,0 +1,38 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 1.0
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         444650           4640510          0                
+      ModelPixelScaleTag (1,3):
+         10               10               0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      GTCitationGeoKey (Ascii,20): "UTM Zone 16N NAD27""
+      GeogCitationGeoKey (Ascii,24): "Clarke, 1866 by Default"
+      ProjectedCSTypeGeoKey (Short,1): PCS_NAD27_UTM_zone_16N
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 26716 (NAD27 / UTM zone 16N)
+Projection = 16016 (UTM zone 16N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -87.000000 ( 87d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4267/NAD27
+Datum: 6267/North American Datum 1927
+Ellipsoid: 7008/Clarke 1866 (6378206.40,6356583.80)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 444650.000,4640510.000)  ( 87d40' 2.80"W, 41d54'59.49"N)
+Lower Left    ( 444650.000,4631220.000)  ( 87d39'59.67"W, 41d49'58.28"N)
+Upper Right   ( 451640.000,4640510.000)  ( 87d34'59.37"W, 41d55' 1.14"N)
+Lower Right   ( 451640.000,4631220.000)  ( 87d34'56.64"W, 41d49'59.92"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.txt
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.txt	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/spot/UTM2GTIF.txt	(revision 31746)
@@ -0,0 +1,18 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 1.0
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                  0                  0                  
+         444650             4640510            0                  
+      ModelPixelScaleTag (1,3):
+         10.0               10.0               0                  
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      GTCitationGeoKey (Ascii,20): "UTM Zone 16N NAD27""
+      GeogCitationGeoKey (Ascii,24): "Clarke, 1866 by Default"
+      ProjectedCSTypeGeoKey (Short,1): PCS_NAD27_UTM_zone_16N
+      End_Of_Keys.
+   End_Of_Geotiff.
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/README
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/README	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/README	(revision 31746)
@@ -0,0 +1,45 @@
+About these files:
+
+These are USGS Image digital elevation model datasets,
+reprocessed by SPOT and stored in GeoTIFF georeferenced 
+format. A valid GeoTIFF 1.0 reader should be able to 
+handle any of these files (assuming they can handle 
+16-bit pixels), without any further metadata. 
+
+The ".txt" files give a metadata dump of the 
+corresponding. ".tif" datasets.  The only difference between 
+the "m" files and the "i" files is byte-order, which 
+valid TIFF readers should be able to handle on the fly. 
+
+The 16-bit GeoTIFF files are made by Dr. Niles Ritter of 
+NASA-JPL (Jet Propulsion Laboratory) from inputs provided 
+by SPOT Image Corporation.  These files are available for
+public examination, demonstration, or other support
+of the GeoTIFF format.  
+
+Please send comments regarding these files to the
+GeoTIFF email routing:
+
+mailto: geotiff-list@tazboy.JPL.NASA.GOV 
+
+Comments not for broad distibution may be sent to:
+
+ruth@spot.com
+
+More info about GeoTIFF can be found from the 
+NASA/JPL GeoTIFF Home Page:
+
+http://www-mipl.jpl.nasa.gov/cartlab/geotiff/geotiff.html
+
+The GeoTIFF page and others are pointed to from the SPOT GeoTIFF page:
+
+http://www.spot.com/anglaise/news/press/devconf/resource.htm
+
+... and FAQ:
+
+http://www.spot.com/anglaise/news/press/devconf/gtiffaq.htm
+
+Thanks for your interest in GeoTIFF format.  
+
+... Mike Ruth
+SPOT Image Corp
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/c41078a1.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/c41078a1.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/c41078a1.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         576496.823       4660453.59       0                
+      ModelPixelScaleTag (1,3):
+         25.400001        25.400001        0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 576496.823,4660453.588)  ( 80d 4'29.95"W, 42d 5'32.78"N)
+Lower Left    ( 576496.823,4518391.383)  ( 80d 5'34.76"W, 40d48'46.70"N)
+Upper Right   ( 759427.631,4660453.588)  ( 77d51'54.10"W, 42d 3'11.98"N)
+Lower Right   ( 759427.631,4518391.383)  ( 77d55'33.34"W, 40d46'32.06"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/f41078a1.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/f41078a1.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/f41078a1.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         664354.283       4601368.61       0                
+      ModelPixelScaleTag (1,3):
+         10.16            10.16            0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 664354.283,4601368.607)  ( 79d 1'45.93"W, 41d32'49.57"N)
+Lower Left    ( 664354.283,4537888.927)  ( 79d 2'47.53"W, 40d58'32.25"N)
+Upper Right   ( 765151.643,4601368.607)  ( 77d49'20.40"W, 41d31'12.24"N)
+Lower Right   ( 765151.643,4537888.927)  ( 77d50'59.61"W, 40d56'56.84"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/f41078e1.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/f41078e1.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/f41078e1.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         663061.704       4656892.36       0                
+      ModelPixelScaleTag (1,3):
+         10.16            10.16            0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 663061.704,4656892.360)  ( 79d 1'46.77"W, 42d 2'49.83"N)
+Lower Left    ( 663061.704,4593402.520)  ( 79d 2'49.46"W, 41d28'32.36"N)
+Upper Right   ( 763249.464,4656892.360)  ( 77d49'13.84"W, 42d 1'12.11"N)
+Lower Right   ( 763249.464,4593402.520)  ( 77d50'54.87"W, 41d26'56.57"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a1.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a1.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a1.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         740726.437       4557390.41       0                
+      ModelPixelScaleTag (1,3):
+         2.4384           2.4384           0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 740726.437,4557390.415)  ( 78d 7'55.55"W, 41d 7'55.69"N)
+Lower Left    ( 740726.437,4540826.364)  ( 78d 8'18.84"W, 40d58'59.20"N)
+Upper Right   ( 752996.466,4557390.415)  ( 77d59' 9.98"W, 41d 7'42.26"N)
+Lower Right   ( 752996.466,4540826.364)  ( 77d59'34.46"W, 40d58'45.84"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a2.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a2.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a2.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         730232.51        4557035.33       0                
+      ModelPixelScaleTag (1,3):
+         2.4384           2.4384           0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 730232.510,4557035.327)  ( 78d15'25.59"W, 41d 7'55.15"N)
+Lower Left    ( 730232.510,4540490.783)  ( 78d15'47.85"W, 40d58'59.23"N)
+Upper Right   ( 742478.155,4557035.327)  ( 78d 6'41.02"W, 41d 7'42.31"N)
+Lower Right   ( 742478.155,4540490.783)  ( 78d 7' 4.45"W, 40d58'46.47"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a3.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a3.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a3.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         719741.284       4556694.15       0                
+      ModelPixelScaleTag (1,3):
+         2.4384           2.4384           0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 719741.284,4556694.152)  ( 78d22'55.53"W, 41d 7'54.56"N)
+Lower Left    ( 719741.284,4540171.553)  ( 78d23'16.74"W, 40d58'59.30"N)
+Upper Right   ( 731960.107,4556694.152)  ( 78d14'12.05"W, 41d 7'42.32"N)
+Lower Right   ( 731960.107,4540171.553)  ( 78d14'34.43"W, 40d58'47.13"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a4.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a4.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a4.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         709245.968       4556369.32       0                
+      ModelPixelScaleTag (1,3):
+         2.4384           2.4384           0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 709245.968,4556369.320)  ( 78d30'25.64"W, 41d 7'54.02"N)
+Lower Left    ( 709245.968,4539861.352)  ( 78d30'45.83"W, 40d58'59.18"N)
+Upper Right   ( 721442.844,4556369.320)  ( 78d21'43.05"W, 41d 7'42.37"N)
+Lower Right   ( 721442.844,4539861.352)  ( 78d22' 4.40"W, 40d58'47.60"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a5.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a5.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a5.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         698753.305       4556059.51       0                
+      ModelPixelScaleTag (1,3):
+         2.4384           2.4384           0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 698753.305,4556059.506)  ( 78d37'55.65"W, 41d 7'53.47"N)
+Lower Left    ( 698753.305,4539568.607)  ( 78d38'14.80"W, 40d58'59.14"N)
+Upper Right   ( 710925.798,4556059.506)  ( 78d29'14.05"W, 41d 7'42.42"N)
+Lower Right   ( 710925.798,4539568.607)  ( 78d29'34.37"W, 40d58'48.14"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a6.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a6.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a6.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         688258.224       4555765.97       0                
+      ModelPixelScaleTag (1,3):
+         2.4384           2.4384           0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 688258.224,4555765.966)  ( 78d45'25.76"W, 41d 7'52.96"N)
+Lower Left    ( 688258.224,4539289.697)  ( 78d45'43.88"W, 40d58'59.06"N)
+Upper Right   ( 700411.209,4555765.966)  ( 78d36'44.95"W, 41d 7'42.49"N)
+Lower Right   ( 700411.209,4539289.697)  ( 78d37' 4.24"W, 40d58'48.64"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a7.lgo
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a7.lgo	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/data/geotiff/usgs/o41078a7.lgo	(revision 31746)
@@ -0,0 +1,37 @@
+Geotiff_Information:
+   Version: 1
+   Key_Revision: 0.1
+   Tagged_Information:
+      ModelTiepointTag (2,3):
+         0                0                0                
+         677765.001       4555485.25       0                
+      ModelPixelScaleTag (1,3):
+         2.4384           2.4384           0                
+      End_Of_Tags.
+   Keyed_Information:
+      GTModelTypeGeoKey (Short,1): ModelTypeProjected
+      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
+      ProjectedCSTypeGeoKey (Short,1): PCS_WGS84_UTM_zone_17N
+      PCSCitationGeoKey (Ascii,25): "UTM Zone 17 N with WGS84"
+      End_Of_Keys.
+   End_Of_Geotiff.
+
+PCS = 32617 (WGS 84 / UTM zone 17N)
+Projection = 16017 (UTM zone 17N)
+Projection Method: CT_TransverseMercator
+   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
+   ProjNatOriginLongGeoKey: -81.000000 ( 81d 0' 0.00"W)
+   ProjScaleAtNatOriginGeoKey: 0.999600
+   ProjFalseEastingGeoKey: 500000.000000
+   ProjFalseNorthingGeoKey: 0.000000
+GCS: 4326/WGS 84
+Datum: 6326/World Geodetic System 1984
+Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
+Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
+Projection Linear Units: 9001/meter (1.000000m)
+
+Corner Coordinates:
+Upper Left    ( 677765.001,4555485.245)  ( 78d52'55.79"W, 41d 7'52.38"N)
+Lower Left    ( 677765.001,4539028.484)  ( 78d53'12.89"W, 40d58'59.07"N)
+Upper Right   ( 689893.603,4555485.245)  ( 78d44'15.98"W, 41d 7'42.50"N)
+Lower Right   ( 689893.603,4539028.484)  ( 78d44'34.24"W, 40d58'49.23"N)
Index: /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java
===================================================================
--- /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java	(revision 31746)
+++ /applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/GeoTiffReaderTest.java	(revision 31746)
@@ -0,0 +1,70 @@
+package org.openstreetmap.josm.plugins.ImportImagePlugin;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.DirectoryIteratorException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.geotools.coverage.grid.GridCoverage2D;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.TestUtils;
+
+/**
+ * Test that some geotiff sample files can be read.
+ * Data downloaded from <a href="ftp://ftp.remotesensing.org/pub/geotiff/samples">remotesensing.org</a>.
+ */
+public class GeoTiffReaderTest {
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        JOSMFixture.createUnitTestFixture().init();
+        new ImportImagePlugin(null);
+    }
+
+    @Test
+    public void testReadGeoTiffFiles() throws IOException {
+        for (Path p : listDataFiles("tif")) {
+            File file = p.toFile();
+            Main.info("Testing reading file "+file.getPath());
+            GridCoverage2D grid = PluginOperations.createGridFromFile(file, null, false);
+            assertNotNull(grid);
+        }
+    }
+    
+    /**
+     * Lists all datasets files matching given extension.
+     * @param ext file extension to search for
+     * @returns List of all datasets files matching given extension
+     * @throws IOException in case of I/O error
+     */
+    public static Collection<Path> listDataFiles(String ext) throws IOException {
+        Collection<Path> result = new ArrayList<>();
+        addTree(Paths.get(TestUtils.getTestDataRoot()+"geotiff"), result, ext.toLowerCase());
+        return result;
+    }
+    
+    static void addTree(Path directory, Collection<Path> all, String ext) throws IOException {
+        try (DirectoryStream<Path> ds = Files.newDirectoryStream(directory)) {
+            for (Path child : ds) {
+                if (Files.isDirectory(child)) {
+                    addTree(child, all, ext);
+                } else if (child.toString().toLowerCase().endsWith(ext)) {
+                    all.add(child);
+                }
+            }
+        } catch (DirectoryIteratorException ex) {
+            // I/O error encounted during the iteration, the cause is an IOException
+            throw ex.getCause();
+        }
+    }
+}
