]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 20 Jul 2012 13:27:40 +0000 (13:27 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 20 Jul 2012 13:27:40 +0000 (13:27 +0000)
MagickCore/blob.c
MagickCore/constitute.c

index 0ebe6299640c717eb1fb2bf60c0e9aaabc53445b..490b287165cc844559c2a3b4bd9ad29c289ef697 100644 (file)
@@ -2397,22 +2397,6 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__OS2__)
       if (strchr(type,'b') != (char *) NULL)
         setmode(_fileno(image->blob->file_info.file),_O_BINARY);
-#endif
-      image->blob->type=StandardStream;
-      image->blob->exempt=MagickTrue;
-      return(MagickTrue);
-    }
-  if (LocaleNCompare(filename,"fd:",3) == 0)
-    {
-      char
-        mode[MaxTextExtent];
-
-      *mode=(*type);
-      mode[1]='\0';
-      image->blob->file_info.file=fdopen(StringToLong(filename+3),mode);
-#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__OS2__)
-      if (strchr(type,'b') != (char *) NULL)
-        setmode(_fileno(image->blob->file_info.file),_O_BINARY);
 #endif
       image->blob->type=StandardStream;
       image->blob->exempt=MagickTrue;
index 1123bc58904def62a92b96ef6dd192ca634bbcd9..98b313f4ad7208d449b2825a41f0c77415ebe903 100644 (file)
@@ -461,6 +461,12 @@ MagickExport Image *ReadImage(const ImageInfo *image_info,
         "NotAuthorized","'%s'",read_info->filename);
       return((Image *) NULL);
     }
+  if ((LocaleNCompare(filename,"fd:",3) == 0) &&
+      (image_info->file == (FILE *) NULL))
+    {
+      read_info->file=fdopen(StringToLong(filename+3),"rb");
+      SetImageInfoFile((ImageInfo *) image_info,read_info->file);
+    }
   /*
     Call appropriate image reader based on image type.
   */
@@ -1065,6 +1071,15 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info,
       errno=EPERM;
       ThrowBinaryException(PolicyError,"NotAuthorized",filename);
     }
+  if ((LocaleNCompare(filename,"fd:",3) == 0) &&
+      (image_info->file == (FILE *) NULL))
+    {
+      write_info->file=fdopen(StringToLong(filename+3),"rb");
+      SetImageInfoFile((ImageInfo *) image_info,write_info->file);
+    }
+  /*
+    Call appropriate image reader based on image type.
+  */
   magick_info=GetMagickInfo(write_info->magick,sans_exception);
   sans_exception=DestroyExceptionInfo(sans_exception);
   if (magick_info != (const MagickInfo *) NULL)