From: cristy Date: Tue, 7 Feb 2012 12:19:58 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6234 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e724ba5d4a031534c55b2b63cb38b093fae9e2d4;p=imagemagick --- diff --git a/MagickCore/distort.c b/MagickCore/distort.c index 7ba1ebdf7..0fd671a97 100644 --- a/MagickCore/distort.c +++ b/MagickCore/distort.c @@ -2790,6 +2790,7 @@ MagickExport Image *RotateImage(const Image *image,const double degrees, ExceptionInfo *exception) { Image + *distort_image, *rotate_image; MagickRealType @@ -2801,9 +2802,6 @@ MagickExport Image *RotateImage(const Image *image,const double degrees, size_t rotations; - VirtualPixelMethod - method; - /* Adjust rotation angle. */ @@ -2823,13 +2821,16 @@ MagickExport Image *RotateImage(const Image *image,const double degrees, shear.y=sin((double) DegreesToRadians(angle)); if ((fabs(shear.x) < MagickEpsilon) && (fabs(shear.y) < MagickEpsilon)) return(IntegralRotateImage(image,rotations,exception)); - if ((image->background_color.matte != MagickFalse) && - (image->matte == MagickFalse)) - (void) SetImageAlpha(image,OpaqueAlpha,exception); - method=SetImageVirtualPixelMethod(image,BackgroundVirtualPixelMethod); - rotate_image=DistortImage(image,ScaleRotateTranslateDistortion,1,°rees, - MagickTrue,exception); - method=SetImageVirtualPixelMethod(image,method); + distort_image=CloneImage(image,0,0,MagickTrue,exception); + if (distort_image == (Image *) NULL) + return((Image *) NULL); + if ((distort_image->background_color.matte != MagickFalse) && + (distort_image->matte == MagickFalse)) + (void) SetImageAlpha(distort_image,OpaqueAlpha,exception); + (void) SetImageVirtualPixelMethod(distort_image,BackgroundVirtualPixelMethod); + rotate_image=DistortImage(distort_image,ScaleRotateTranslateDistortion,1, + °rees,MagickTrue,exception); + distort_image=DestroyImage(distort_image); return(rotate_image); }