]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 14 Dec 2011 01:50:13 +0000 (01:50 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 14 Dec 2011 01:50:13 +0000 (01:50 +0000)
MagickCore/fx.c
MagickCore/fx.h
MagickWand/magick-image.c
MagickWand/magick-image.h
MagickWand/mogrify.c
MagickWand/operation.c
PerlMagick/Magick.xs

index 570a6196b5c4fdb9b88c71513e51c4865b4daabc..30e34bea5513ce06cb6a484b0c11ad3d45424796 100644 (file)
@@ -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);
index d3c93f1c5517ffebe24ce9052786c5b172afbcb9..2a32bb328566f60608e2917e79d91d362b35202c 100644 (file)
@@ -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,
index 405f84d91afc36e8618fff1374f8a1070dd53814..638f794343906e3f78abb9878112d6bbe7d1f769 100644 (file)
@@ -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);
index 5f12b6f69bc288b876223f7ea0d9c54abda08018..42dfafb5877091a4b6592d0dd93d1261016aaa60 100644 (file)
@@ -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,
index 7503e1fb0a2c3cce664c7c471a1fcc40fe90c7ae..e0c288c54bb4fcd7d99b01c9acbb390e0a232403 100644 (file)
@@ -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;
           }
index 9b22742ff9089283733b5afcc080068ada932ff5..24770014ef09bcd7352c1c2e3cbd2cb6e7f1aa7c 100644 (file)
@@ -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;
         }
index 2295ab08b50d372de2acca416e49b0652f482ccb..02263d563de726d1d90e5db1a3588e4bd80fbf0c 100644 (file)
@@ -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 */