From: cristy Date: Wed, 14 Dec 2011 01:50:13 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6544 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9e3d389ed5873131a570d26375abeb93e688740;p=imagemagick --- diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 570a6196b..30e34bea5 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -3873,8 +3873,8 @@ MagickExport MagickBooleanType PlasmaImage(Image *image, % The format of the AnnotateImage method is: % % Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, -% const double angle,const PixelInterpolateMethod method, -% ExceptionInfo exception) +% const char *caption,const double angle, +% const PixelInterpolateMethod method,ExceptionInfo exception) % % A description of each parameter follows: % @@ -3882,6 +3882,8 @@ MagickExport MagickBooleanType PlasmaImage(Image *image, % % o draw_info: the draw info. % +% o caption: the Polaroid caption. +% % o angle: Apply the effect along this angle. % % o method: the pixel interpolation method. @@ -3890,12 +3892,9 @@ MagickExport MagickBooleanType PlasmaImage(Image *image, % */ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, - const double angle,const PixelInterpolateMethod method, + const char *caption,const double angle,const PixelInterpolateMethod method, ExceptionInfo *exception) { - const char - *value; - Image *bend_image, *caption_image, @@ -3924,12 +3923,11 @@ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, image->rows)/25.0,10.0); height=image->rows+2*quantum; caption_image=(Image *) NULL; - value=GetImageProperty(image,"caption",exception); - if (value != (const char *) NULL) + if (caption != (const char *) NULL) { char - *caption, - geometry[MaxTextExtent]; + geometry[MaxTextExtent], + *text; DrawInfo *annotate_info; @@ -3950,20 +3948,20 @@ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, if (caption_image == (Image *) NULL) return((Image *) NULL); annotate_info=CloneDrawInfo((const ImageInfo *) NULL,draw_info); - caption=InterpretImageProperties((ImageInfo *) NULL,(Image *) image, - value,exception); - (void) CloneString(&annotate_info->text,caption); + text=InterpretImageProperties((ImageInfo *) NULL,(Image *) image,caption, + exception); + (void) CloneString(&annotate_info->text,text); count=FormatMagickCaption(caption_image,annotate_info,MagickTrue,&metrics, - &caption,exception); - status=SetImageExtent(caption_image,image->columns,(size_t) - ((count+1)*(metrics.ascent-metrics.descent)+0.5),exception); + &text,exception); + status=SetImageExtent(caption_image,image->columns,(size_t) ((count+1)* + (metrics.ascent-metrics.descent)+0.5),exception); if (status == MagickFalse) caption_image=DestroyImage(caption_image); else { caption_image->background_color=image->border_color; (void) SetImageBackgroundColor(caption_image,exception); - (void) CloneString(&annotate_info->text,caption); + (void) CloneString(&annotate_info->text,text); (void) FormatLocaleString(geometry,MaxTextExtent,"+0+%g", metrics.ascent); if (annotate_info->gravity == UndefinedGravity) @@ -3973,7 +3971,7 @@ MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info, height+=caption_image->rows; } annotate_info=DestroyDrawInfo(annotate_info); - caption=DestroyString(caption); + text=DestroyString(text); } picture_image=CloneImage(image,image->columns+2*quantum,height,MagickTrue, exception); diff --git a/MagickCore/fx.h b/MagickCore/fx.h index d3c93f1c5..2a32bb328 100644 --- a/MagickCore/fx.h +++ b/MagickCore/fx.h @@ -47,7 +47,7 @@ extern MagickExport Image *ImplodeImage(const Image *,const double,const PixelInterpolateMethod, ExceptionInfo *), *MorphImages(const Image *,const size_t,ExceptionInfo *), - *PolaroidImage(const Image *,const DrawInfo *,const double, + *PolaroidImage(const Image *,const DrawInfo *,const char *,const double, const PixelInterpolateMethod,ExceptionInfo *), *SepiaToneImage(const Image *,const double,ExceptionInfo *), *ShadowImage(const Image *,const double,const double,const double, diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 405f84d91..638f79434 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -7202,7 +7202,7 @@ WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file) % The format of the MagickPolaroidImage method is: % % MagickBooleanType MagickPolaroidImage(MagickWand *wand, -% const DrawingWand *drawing_wand,const double angle, +% const DrawingWand *drawing_wand,const char *caption,const double angle, % const PixelInterpolateMethod method) % % A description of each parameter follows: @@ -7211,13 +7211,15 @@ WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file) % % o drawing_wand: the draw wand. % +% o caption: the Polaroid caption. +% % o angle: Apply the effect along this angle. % % o method: the pixel interpolation method. % */ WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand, - const DrawingWand *drawing_wand,const double angle, + const DrawingWand *drawing_wand,const char *caption,const double angle, const PixelInterpolateMethod method) { DrawInfo @@ -7235,7 +7237,7 @@ WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand, draw_info=PeekDrawingWand(drawing_wand); if (draw_info == (DrawInfo *) NULL) return(MagickFalse); - polaroid_image=PolaroidImage(wand->images,draw_info,angle,method, + polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method, wand->exception); if (polaroid_image == (Image *) NULL) return(MagickFalse); diff --git a/MagickWand/magick-image.h b/MagickWand/magick-image.h index 5f12b6f69..42dfafb58 100644 --- a/MagickWand/magick-image.h +++ b/MagickWand/magick-image.h @@ -198,8 +198,8 @@ extern WandExport MagickBooleanType MagickPingImage(MagickWand *,const char *), MagickPingImageBlob(MagickWand *,const void *,const size_t), MagickPingImageFile(MagickWand *,FILE *), - MagickPolaroidImage(MagickWand *,const DrawingWand *,const double, - const PixelInterpolateMethod), + MagickPolaroidImage(MagickWand *,const DrawingWand *,const char *, + const double,const PixelInterpolateMethod), MagickPosterizeImage(MagickWand *,const size_t,const MagickBooleanType), MagickPreviousImage(MagickWand *), MagickQuantizeImage(MagickWand *,const size_t,const ColorspaceType, diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 7503e1fb0..e0c288c54 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -2300,6 +2300,9 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, } if (LocaleCompare("polaroid",option+1) == 0) { + const char + *caption; + double angle; @@ -2319,7 +2322,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, flags=ParseGeometry(argv[i+1],&geometry_info); angle=geometry_info.rho; } - mogrify_image=PolaroidImage(*image,draw_info,angle, + caption=GetImageProperty(*image,"caption",exception); + mogrify_image=PolaroidImage(*image,draw_info,caption,angle, interpolate_method,exception); break; } diff --git a/MagickWand/operation.c b/MagickWand/operation.c index 9b22742ff..24770014e 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -2935,6 +2935,9 @@ WandExport MagickBooleanType ApplySettingsOption(MagickWand *wand, } if (LocaleCompare("polaroid",option) == 0) { + const char + *caption; + double angle; @@ -2954,7 +2957,8 @@ WandExport MagickBooleanType ApplySettingsOption(MagickWand *wand, flags=ParseGeometry(args[0],&geometry_info); angle=geometry_info.rho; } - new_image=PolaroidImage(*image,draw_info,angle, + caption=GetImageProperty(*image,"caption",exception); + new_image=PolaroidImage(*image,draw_info,caption,angle, interpolate_method,exception); break; } diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index 2295ab08b..02263d563 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -10251,6 +10251,9 @@ Mogrify(ref,...) } case 110: /* Polaroid */ { + char + *caption; + DrawInfo *draw_info; @@ -10262,10 +10265,11 @@ Mogrify(ref,...) draw_info=CloneDrawInfo(info ? info->image_info : (ImageInfo *) NULL, (DrawInfo *) NULL); + caption=(char *) NULL; if (attribute_flag[0] != 0) - (void) SetImageProperty(image,"caption",InterpretImageProperties( - info ? info->image_info : (ImageInfo *) NULL,image, - argument_list[0].string_reference,exception),exception); + caption=InterpretImageProperties(info ? info->image_info : + (ImageInfo *) NULL,image,argument_list[0].string_reference, + exception); angle=0.0; if (attribute_flag[1] != 0) angle=argument_list[1].real_reference; @@ -10290,8 +10294,10 @@ Mogrify(ref,...) method=UndefinedInterpolatePixel; if (attribute_flag[9] != 0) method=(PixelInterpolateMethod) argument_list[9].integer_reference; - image=PolaroidImage(image,draw_info,angle,method,exception); + image=PolaroidImage(image,draw_info,caption,angle,method,exception); draw_info=DestroyDrawInfo(draw_info); + if (caption != (char *) NULL) + caption=DestroyString(caption); break; } case 111: /* FloodfillPaint */