]> granicus.if.org Git - imagemagick/commitdiff
Fixed incorrect 'delta' increment calculation in Equal tile crop
authoranthony <anthony@git.imagemagick.org>
Fri, 2 Dec 2011 06:15:43 +0000 (06:15 +0000)
committeranthony <anthony@git.imagemagick.org>
Fri, 2 Dec 2011 06:15:43 +0000 (06:15 +0000)
MagickCore/transform.c

index bbdfb79b02b5d2f5e763038ada66203d66d5b871..7e2021cf8ccfdbf861b8b19e98cb36a791c63258 100644 (file)
@@ -747,14 +747,8 @@ MagickExport Image *CropImageToTiles(const Image *image,
           width+=(geometry.x < 0 ? -1 : 1)*geometry.x;
           height+=(geometry.y < 0 ? -1 : 1)*geometry.y;
         }
-      if ((width % geometry.width) != 0)
-        delta.x=(double) (width+(geometry.width >> 1))/geometry.width;
-      else
-        delta.x=(double) width/geometry.width;
-      if ((height % geometry.height) != 0)
-        delta.y=(double) (height+(geometry.height >> 1))/geometry.height;
-      else
-        delta.y=(double) height/geometry.height;
+      delta.x=((double)width)/((double)geometry.width);
+      delta.y=((double)height)/((double)geometry.height);
       for (offset.y=0; offset.y < (double) height; )
       {
         if ((flags & AspectValue) == 0)