]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/transform.c
(no commit message)
[imagemagick] / MagickCore / transform.c
index 092f7943a82e94d08b0209c5387bc40137699bbd..5af3014a1bd214a1002d33f94e62159ba314a011 100644 (file)
 %                    MagickCore Image Transform Methods                       %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -698,6 +698,7 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry,
 
       if (GetPixelReadMask(image,p) == 0)
         {
+          SetPixelBackgoundColor(crop_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(crop_image);
           continue;
@@ -1053,6 +1054,7 @@ MagickExport Image *ExcerptImage(const Image *image,
 
       if (GetPixelReadMask(image,p) == 0)
         {
+          SetPixelBackgoundColor(excerpt_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(excerpt_image);
           continue;
@@ -1253,6 +1255,7 @@ MagickExport Image *FlipImage(const Image *image,ExceptionInfo *exception)
 
       if (GetPixelReadMask(image,p) == 0)
         {
+          SetPixelBackgoundColor(flip_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(flip_image);
           continue;
@@ -1481,6 +1484,8 @@ static inline MagickBooleanType CopyImageRegion(Image *destination,
   ssize_t
     y;
 
+  if (columns == 0)
+    return(MagickTrue);
   status=MagickTrue;
   source_view=AcquireVirtualCacheView(source,exception);
   destination_view=AcquireAuthenticCacheView(destination,exception);
@@ -1521,6 +1526,7 @@ static inline MagickBooleanType CopyImageRegion(Image *destination,
 
       if (GetPixelReadMask(source,p) == 0)
         {
+          SetPixelBackgoundColor(destination,q);
           p+=GetPixelChannels(source);
           q+=GetPixelChannels(destination);
           continue;
@@ -1591,14 +1597,14 @@ MagickExport Image *RollImage(const Image *image,const ssize_t x_offset,
     (size_t) offset.y,(ssize_t) image->columns-offset.x,(ssize_t) image->rows-
     offset.y,0,0,exception);
   (void) SetImageProgress(image,RollImageTag,0,3);
-  status|=CopyImageRegion(roll_image,image,image->columns-offset.x,
+  status&=CopyImageRegion(roll_image,image,image->columns-offset.x,
     (size_t) offset.y,0,(ssize_t) image->rows-offset.y,offset.x,0,
     exception);
   (void) SetImageProgress(image,RollImageTag,1,3);
-  status|=CopyImageRegion(roll_image,image,(size_t) offset.x,image->rows-
+  status&=CopyImageRegion(roll_image,image,(size_t) offset.x,image->rows-
     offset.y,(ssize_t) image->columns-offset.x,0,0,offset.y,exception);
   (void) SetImageProgress(image,RollImageTag,2,3);
-  status|=CopyImageRegion(roll_image,image,image->columns-offset.x,image->rows-
+  status&=CopyImageRegion(roll_image,image,image->columns-offset.x,image->rows-
     offset.y,0,0,offset.x,offset.y,exception);
   (void) SetImageProgress(image,RollImageTag,3,3);
   roll_image->type=image->type;
@@ -1839,6 +1845,7 @@ MagickExport Image *SpliceImage(const Image *image,
 
       if (GetPixelReadMask(image,p) == 0)
         {
+          SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(splice_image);
           continue;
@@ -1865,6 +1872,7 @@ MagickExport Image *SpliceImage(const Image *image,
 
       if (GetPixelReadMask(image,p) == 0)
         {
+          SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(splice_image);
           continue;
@@ -1934,6 +1942,7 @@ MagickExport Image *SpliceImage(const Image *image,
 
       if (GetPixelReadMask(image,q) == 0)
         {
+          SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(splice_image);
           continue;
@@ -1960,6 +1969,7 @@ MagickExport Image *SpliceImage(const Image *image,
 
       if (GetPixelReadMask(image,q) == 0)
         {
+          SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(splice_image);
           continue;
@@ -2163,7 +2173,7 @@ MagickExport MagickBooleanType TransformImages(Image **images,
   for (i=0; image_list[i] != (Image *) NULL; i++)
   {
     image=image_list[i];
-    status|=TransformImage(&image,crop_geometry,image_geometry,exception);
+    status&=TransformImage(&image,crop_geometry,image_geometry,exception);
     AppendImageToList(&transform_images,image);
   }
   *images=transform_images;
@@ -2269,6 +2279,7 @@ MagickExport Image *TransposeImage(const Image *image,ExceptionInfo *exception)
 
       if (GetPixelReadMask(image,q) == 0)
         {
+          SetPixelBackgoundColor(transpose_image,q);
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(transpose_image);
           continue;