]> granicus.if.org Git - imagemagick/commitdiff
The -caption option no longer fails for filenames with @ prefix
authorCristy <urban-warrior@imagemagick.org>
Fri, 2 Oct 2015 22:59:32 +0000 (18:59 -0400)
committerCristy <urban-warrior@imagemagick.org>
Fri, 2 Oct 2015 22:59:32 +0000 (18:59 -0400)
MagickCore/fx.c
MagickCore/property.c
MagickCore/property.o [new file with mode: 0644]

index 95b35b0495fd9dd28bcd592317063c7556353c02..52bf04dabeb86ff0ce02cf6d35d7cda277328956 100644 (file)
@@ -3936,7 +3936,7 @@ MagickExport MagickBooleanType PlasmaImage(Image *image,
 %
 %  PolaroidImage() simulates a Polaroid picture.
 %
-%  The format of the AnnotateImage method is:
+%  The format of the PolaroidImage method is:
 %
 %      Image *PolaroidImage(const Image *image,const DrawInfo *draw_info,
 %        const char *caption,const double angle,
index 9d2f7775970c5c3c20aeb1c5fc564cceacd5ce91..cf007996fda51c235f2e4b4a55f2d46a877ab158 100644 (file)
@@ -3222,13 +3222,13 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,
     *interpret_text;
 
   register char
-    *q;     /* current position in interpret_text */
+    *q;  /* current position in interpret_text */
 
   register const char
-    *p;     /* position in embed_text string being expanded */
+    *p;  /* position in embed_text string being expanded */
 
   size_t
-    extent; /* allocated length of interpret_text */
+    extent;  /* allocated length of interpret_text */
 
   MagickBooleanType
     number;
@@ -3242,22 +3242,19 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s","no-image");
 
   if (embed_text == (const char *) NULL)
-    return((char *) NULL);
+    return(ConstantString(""));
   p=embed_text;
 
   if (*p == '\0')
     return(ConstantString(""));
 
-  /* handle a '@' replace string from file */
-  if (*p == '@') {
-     p++;
-     if (*p != '-' && IfMagickFalse(IsPathAccessible(p)) ) {
-       (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
-         "UnableToAccessPath","%s",p);
-       return((char *) NULL);
-     }
-     return(FileToString(p,~0UL,exception));
-  }
+  if ((*p == '@') && (IsPathAccessible(p+1) != MagickFalse))
+    {
+      /* handle a '@' replace string from file */
+      interpret_text=FileToString(p+1,~0UL,exception);
+      if (interpret_text != (char *) NULL)
+        return(interpret_text);
+    }
 
   /*
     Translate any embedded format characters.
diff --git a/MagickCore/property.o b/MagickCore/property.o
new file mode 100644 (file)
index 0000000..5c48384
Binary files /dev/null and b/MagickCore/property.o differ