Index: src/java/org/apache/fop/image/TIFFImage.java
===================================================================
--- src/java/org/apache/fop/image/TIFFImage.java	(revision 572913)
+++ src/java/org/apache/fop/image/TIFFImage.java	(working copy)
@@ -73,26 +73,35 @@
             = new org.apache.xmlgraphics.image.codec.tiff.TIFFImage
                 (stream, null, 0);
         TIFFDirectory dir = (TIFFDirectory)img.getProperty("tiff_directory");
-        TIFFField fld = dir.getField(TIFFImageDecoder.TIFF_RESOLUTION_UNIT);
-        int resUnit = fld.getAsInt(0);
-        fld = dir.getField(TIFFImageDecoder.TIFF_X_RESOLUTION);
-        double xRes = fld.getAsDouble(0);
+        TIFFField fld = dir.getField(TIFFImageDecoder.TIFF_X_RESOLUTION);
+        if (fld != null) {
+            log.debug("x resolution = " + fld.getAsDouble(0));                
+            this.dpiHorizontal = fld.getAsDouble(0); 
+        } else {
+            log.warn("Cannot determine x resolution.");
+        }
         fld = dir.getField(TIFFImageDecoder.TIFF_Y_RESOLUTION);
-        double yRes = fld.getAsDouble(0);
-        switch (resUnit) {
-        case 2: //inch
-            this.dpiHorizontal = xRes;
-            this.dpiVertical = yRes;
-            break;
-        case 3: //cm
-            this.dpiHorizontal = xRes * 2.54f;
-            this.dpiVertical = yRes * 2.54f;
-            break;
-        default:
-            //ignored
-            log.warn("Cannot determine bitmap resolution."
-                    + " Unimplemented resolution unit: " + resUnit);
+        if (fld != null) {
+            log.debug("y resolution = " + fld.getAsDouble(0));                
+            this.dpiVertical = fld.getAsDouble(0); 
+        } else {
+            log.warn("Cannot determine y resolution.");
         }
+        fld = dir.getField(TIFFImageDecoder.TIFF_RESOLUTION_UNIT);
+        if (fld != null) {
+            int resUnit = fld.getAsInt(0);
+            if (resUnit == 3) {
+              //cm
+                this.dpiHorizontal *= 2.54f;
+                this.dpiVertical *= 2.54f;
+            } else if (resUnit != 2) {
+                //ignored
+                log.warn("Cannot determine bitmap resolution."
+                        + " Unimplemented resolution unit: " + resUnit);
+            }
+        } else {
+            log.warn("Cannot determine bitmap resolution unit.");
+        }            
         fld = dir.getField(TIFFImageDecoder.TIFF_COMPRESSION);
         if (fld != null) {
             compression = fld.getAsInt(0);
