]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 20 Sep 2014 00:44:37 +0000 (00:44 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 20 Sep 2014 00:44:37 +0000 (00:44 +0000)
MagickCore/blob-private.h
MagickCore/blob.c
MagickCore/constitute.c
MagickCore/image.c

index d4f63f1fed6b4fb96e7131498efe90681d8afd62..12b12ff3f8c149b962ec7b0552556e2b5b989b2f 100644 (file)
@@ -58,7 +58,6 @@ extern MagickPrivate StreamHandler
 
 extern MagickPrivate void
   GetBlobInfo(BlobInfo *),
-  GetBlobPrivate(Image *),
   SetBlobExempt(Image *,const MagickBooleanType);
 
 #if defined(__cplusplus) || defined(c_plusplus)
index 5ef8e85523eff350259023b11581178c5773bc57..5c3154b1ba09e0937635ff275255078cd284cbde 100644 (file)
@@ -1292,57 +1292,6 @@ MagickPrivate void GetBlobInfo(BlobInfo *blob_info)
   blob_info->semaphore=AcquireSemaphoreInfo();
   blob_info->signature=MagickSignature;
 }
-
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-+   G e t B l o b P r i v a t e                                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  GetBlobPrivate() checks if the blob of the specified image is referenced by
-%  other images. If the reference_count is higher then 1 a new blob is assigned
-%  to the specified image.
-%
-%  The format of the GetBlobError method is:
-%
-%       void GetBlobPrivate(Image *image)
-%
-%  A description of each parameter follows:
-%
-%    o image: the image.
-%
-*/
-MagickPrivate void GetBlobPrivate(Image *image)
-{
-  BlobInfo
-    *blob;
-
-  MagickBooleanType
-    clone;
-
-  assert(image != (Image *) NULL);
-  assert(image->signature == MagickSignature);
-  if (image->debug != MagickFalse)
-    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  assert(image->blob != (BlobInfo *) NULL);
-  assert(image->blob->signature == MagickSignature);
-  clone=MagickFalse;
-  LockSemaphoreInfo(image->blob->semaphore);
-  assert(image->blob->reference_count >= 0);
-  if (image->blob->reference_count > 1)
-    clone=MagickTrue;
-  UnlockSemaphoreInfo(image->blob->semaphore);
-  if (clone == MagickFalse)
-    return;
-  blob=CloneBlobInfo(image->blob);
-  DestroyBlob(image);
-  image->blob=blob;
-}
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 42c9eaebe7c6ef47f678ac07dcace79650c1ef06..ff4c5d956d909f73b1ef0a70ae8c17581ef48a97 100644 (file)
@@ -1000,7 +1000,6 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info,
   assert(exception != (ExceptionInfo *) NULL);
   sans_exception=AcquireExceptionInfo();
   write_info=CloneImageInfo(image_info);
-  GetBlobPrivate(image);
   (void) CopyMagickString(write_info->filename,image->filename,MaxTextExtent);
   if (*write_info->magick == '\0')
     (void) CopyMagickString(write_info->magick,image->magick,MaxTextExtent);
@@ -1272,7 +1271,6 @@ MagickExport MagickBooleanType WriteImages(const ImageInfo *image_info,
   assert(exception != (ExceptionInfo *) NULL);
   write_info=CloneImageInfo(image_info);
   images=GetFirstImageInList(images);
-  GetBlobPrivate(images);
   if (filename != (const char *) NULL)
     for (p=images; p != (Image *) NULL; p=GetNextImageInList(p))
       (void) CopyMagickString(p->filename,filename,MaxTextExtent);
index 5193e37df0de120316e67299bed1efad01e30796..2cfc6ed41ce1686f4ce230686d270efb0470b66c 100644 (file)
@@ -1135,7 +1135,9 @@ MagickExport ImageInfo *DestroyImageInfo(ImageInfo *image_info)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  DisassociateImageStream() disassociates the image stream.
+%  DisassociateImageStream() disassociates the image stream.  It checks if the
+%  blob of the specified image is referenced by other images. If the reference
+%  count is higher then 1 a new blob is assigned to the specified image.
 %
 %  The format of the DisassociateImageStream method is:
 %
@@ -1148,16 +1150,29 @@ MagickExport ImageInfo *DestroyImageInfo(ImageInfo *image_info)
 */
 MagickExport void DisassociateImageStream(Image *image)
 {
-  unsigned char
-    *data;
+  BlobInfo
+    *blob;
 
-  assert(image != (const Image *) NULL);
+  MagickBooleanType
+    clone;
+
+  assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  data=DetachBlob(image->blob);
-  if (data != (unsigned char *) NULL)
-    data=(unsigned char *) RelinquishMagickMemory(data);
+  assert(image->blob != (BlobInfo *) NULL);
+  assert(image->blob->signature == MagickSignature);
+  clone=MagickFalse;
+  LockSemaphoreInfo(image->blob->semaphore);
+  assert(image->blob->reference_count >= 0);
+  if (image->blob->reference_count > 1)
+    clone=MagickTrue;
+  UnlockSemaphoreInfo(image->blob->semaphore);
+  if (clone == MagickFalse)
+    return;
+  blob=CloneBlobInfo(image->blob);
+  DestroyBlob(image);
+  image->blob=blob;
 }
 \f
 /*