(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 24 Jul 2013 17:26:06 +0000 (17:26 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 24 Jul 2013 17:26:06 +0000 (17:26 +0000)
coders/tiff.c

index db40988d2d07e5a6fcb914c8179b3c274ff5af34..4ebdd231511d7a45a681be3b3690fe8721e4d5c5 100644 (file)
@@ -3201,10 +3201,12 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
             /*
               Set image position.
             */
-            (void) TIFFSetField(tiff,TIFFTAG_XPOSITION,(float) image->page.x/
-              image->resolution.x);
-            (void) TIFFSetField(tiff,TIFFTAG_YPOSITION,(float) image->page.y/
-              image->resolution.y);
+            if (image->resolution.x != 0.0)
+              (void) TIFFSetField(tiff,TIFFTAG_XPOSITION,(float) image->page.x/
+               image->resolution.x);
+            if (image->resolution.y != 0.0)
+              (void) TIFFSetField(tiff,TIFFTAG_YPOSITION,(float) image->page.y/
+                image->resolution.y);
           }
       }
     if (image->chromaticity.white_point.x != 0.0)