]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 5 Sep 2013 16:15:56 +0000 (16:15 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 5 Sep 2013 16:15:56 +0000 (16:15 +0000)
coders/tiff.c

index 8068eaba586caa042f01df67936f3cc28cb18897..dd5127ef224b303bccb75755a6599d0ee6281225 100644 (file)
@@ -3084,10 +3084,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
       if ((image_info->interlace == PlaneInterlace) ||
           (image_info->interlace == PartitionInterlace))
         (void) TIFFSetField(tiff,TIFFTAG_PLANARCONFIG,PLANARCONFIG_SEPARATE);
-    rows_per_strip=1;
-    if (TIFFScanlineSize(tiff) != 0)
-      rows_per_strip=(uint32) MagickMax((size_t) TIFFDefaultStripSize(tiff,0),
-        1);
+     rows_per_strip=TIFFDefaultStripSize(tiff,0);
     option=GetImageOption(image_info,"tiff:rows-per-strip");
     if (option != (const char *) NULL)
       rows_per_strip=(size_t) strtol(option,(char **) NULL,10);
@@ -3197,6 +3194,8 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
       default:
         break;
     }
+    if (rows_per_strip < 1)
+      rows_per_strip=1;
     if ((image->rows/rows_per_strip) >= (1UL << 15))
       rows_per_strip=(image->rows >> 15);
     (void) TIFFSetField(tiff,TIFFTAG_ROWSPERSTRIP,rows_per_strip);