]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Tue, 26 Dec 2017 16:59:35 +0000 (11:59 -0500)
committerCristy <urban-warrior@imagemagick.org>
Tue, 26 Dec 2017 16:59:35 +0000 (11:59 -0500)
MagickCore/blob.c

index e820c8b377dbbbfdac45e693050bb50d7ae1f2eb..f6a7384e14dff1e33584e37eb74dddfdea7abcea 100644 (file)
@@ -2710,12 +2710,19 @@ MagickExport MagickBooleanType IsBlobSeekable(const Image *image)
   blob_info=image->blob;
   switch (blob_info->type)
   {
-    case FileStream:
     case BlobStream:
-    case ZipStream:
       return(MagickTrue);
-    case UndefinedStream:
     case StandardStream:
+    case FileStream:
+    case ZipStream:
+    {
+      int
+        status;
+
+      status=fseek(blob_info->file_info.file,0,SEEK_CUR);
+      return(status == -1 ? MagickFalse : MagickTrue);
+    }
+    case UndefinedStream:
     case BZipStream:
     case FifoStream:
     case PipeStream:
@@ -3089,7 +3096,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
       if (strchr(type,'b') != (char *) NULL)
         setmode(fileno(blob_info->file_info.file),_O_BINARY);
 #endif
-      blob_info->type=StandardStream;
+      blob_info->type=FileStream;
       blob_info->exempt=MagickTrue;
       return(SetStreamBuffering(image_info,image));
     }
@@ -3105,7 +3112,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
       if (strchr(type,'b') != (char *) NULL)
         setmode(fileno(blob_info->file_info.file),_O_BINARY);
 #endif
-      blob_info->type=StandardStream;
+      blob_info->type=FileStream;
       blob_info->exempt=MagickTrue;
       return(SetStreamBuffering(image_info,image));
     }