]> granicus.if.org Git - imagemagick/commitdiff
Set proper page offset for the -append option
authorCristy <urban-warrior@imagemagick.org>
Wed, 21 Dec 2016 21:39:56 +0000 (16:39 -0500)
committerCristy <urban-warrior@imagemagick.org>
Wed, 21 Dec 2016 21:39:56 +0000 (16:39 -0500)
MagickCore/image.c

index 5c09fcab60c683ccec482c49e76b4c5272b9c590..37a74d95ad745ff690d8093cecd346d794f5eb03 100644 (file)
@@ -840,6 +840,8 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns,
   clone_image->alpha_trait=image->alpha_trait;
   clone_image->columns=image->columns;
   clone_image->rows=image->rows;
+  clone_image->page=image->page;
+  clone_image->tile_offset=image->tile_offset;
   clone_image->dither=image->dither;
   if (image->colormap != (PixelInfo *) NULL)
     {
@@ -905,14 +907,10 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns,
   if (image->columns != 0)
     scale=(double) columns/(double) image->columns;
   clone_image->page.width=(size_t) floor(scale*image->page.width+0.5);
-  clone_image->page.x=(ssize_t) ceil(scale*image->page.x-0.5);
-  clone_image->tile_offset.x=(ssize_t) ceil(scale*image->tile_offset.x-0.5);
   scale=1.0;
   if (image->rows != 0)
     scale=(double) rows/(double) image->rows;
   clone_image->page.height=(size_t) floor(scale*image->page.height+0.5);
-  clone_image->page.y=(ssize_t) ceil(scale*image->page.y-0.5);
-  clone_image->tile_offset.y=(ssize_t) ceil(scale*image->tile_offset.y-0.5);
   clone_image->cache=ClonePixelCache(image->cache);
   if (SetImageExtent(clone_image,columns,rows,exception) == MagickFalse)
     clone_image=DestroyImage(clone_image);