Page 1 of 1

Update from 6.5.8 to 6.8.6-7: PSD PingImage reads full data

Posted: 2013-08-08T07:12:46-07:00
by horstr
In 6.5.8, executing PingImage for a large 100MB PSD file returned immediately with no recognizable delay. In 6.8.6-7, PingImage takes around 30 seconds to complete. I assume that all PSD files are affected because 6.8.6-7 does not evaluate the ping flag in ImageInfo anymore, so I did not provide a sample for reproduction. In 6.5.8, ping was evaluated and handled using the following code:

Code: Select all

diff -Naur ImageMagick-6.8.6-7/coders/psd.c ImageMagick-6.8.6-7-dev/coders/psd.c
--- ImageMagick-6.8.6-7/coders/psd.c    2013-08-08 15:50:15.748444761 +0200
+++ ImageMagick-6.8.6-7-dev/coders/psd.c        2013-08-08 15:41:46.928327201 +0200
@@ -927,6 +927,14 @@
       blocks=(unsigned char *) RelinquishMagickMemory(blocks);
     }
   /*
+    If we are only "pinging" the image, then we're done - so return.
+  */
+  if (image_info->ping != MagickFalse)
+    {
+      (void) CloseBlob(image);
+      return(GetFirstImageInList(image));
+    }
+  /*
     Layer and mask block.
   */
   layer_info=(LayerInfo *) NULL;
What was the reason for removing that fragment? Without it, PingImage is practically useless in terms of execution time. Before that, it worked as expected without any noticable delay.

Thanks für looking into it,

Horst.

Re: Update from 6.5.8 to 6.8.6-7: PSD PingImage reads full d

Posted: 2013-08-08T07:51:08-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.6-9 Beta available by sometime tomorrow. Thanks.