]> granicus.if.org Git - imagemagick/commitdiff
Implemented GetBlobSize for a custom stream.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sun, 9 Jul 2017 21:32:04 +0000 (23:32 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sun, 9 Jul 2017 21:32:04 +0000 (23:32 +0200)
MagickCore/blob.c

index 2f86648a2e206386326c73cdb2da1b9b312b79fe..e3cd938d558713d53c754d53f3532230eec14213 100644 (file)
@@ -1518,7 +1518,22 @@ MagickExport MagickSizeType GetBlobSize(const Image *image)
       break;
     }
     case CustomStream:
+    {
+      if ((image->blob->custom_stream->teller != (CustomStreamTeller) NULL) &&
+          (image->blob->custom_stream->seeker != (CustomStreamTeller) NULL))
+        {
+          MagickOffsetType
+            offset;
+
+          offset=image->blob->custom_stream->teller(
+            image->blob->custom_stream->data);
+          extent=image->blob->custom_stream->seeker(0,SEEK_END,
+            image->blob->custom_stream->data);
+          image->blob->custom_stream->seeker(offset,SEEK_SET,
+            image->blob->custom_stream->data);
+        }
       break;
+    }
   }
   return(extent);
 }