#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;
"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.
*/
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)