From: cristy Date: Thu, 1 Dec 2011 16:09:03 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6594 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7246bf7a20eba6831b656123f2965fc7f793a95e;p=imagemagick --- diff --git a/MagickCore/transform.c b/MagickCore/transform.c index 0e10879b5..bbdfb79b0 100644 --- a/MagickCore/transform.c +++ b/MagickCore/transform.c @@ -747,8 +747,14 @@ MagickExport Image *CropImageToTiles(const Image *image, width+=(geometry.x < 0 ? -1 : 1)*geometry.x; height+=(geometry.y < 0 ? -1 : 1)*geometry.y; } - delta.x=(double) (width+(geometry.width >> 1))/geometry.width; - delta.y=(double) (height+(geometry.height >> 1))/geometry.height; + 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; for (offset.y=0; offset.y < (double) height; ) { if ((flags & AspectValue) == 0)