Page 1 of 1

ImageMagick crashing randomly on Windows

Posted: 2012-01-24T14:46:57-07:00
by djeyewater
I'm on Windows 7 and have installed ImageMagick-6.7.4-8-Q16-windows-x64-dll.exe

I'm running a batch script that loops through a folder of images, and calls ImageMagick to crop them. However, sometimes ImageMagick crashes and I get an error message "ImageMagick Studio library and utility programs has stopped working" (a pop-up windows message, not a message in the command prompt). This can happen multiple times as the script loops through the images, or sometimes all the images are processed successfully.

You can download the script and files I am using here: http://www.iliveinabin.com/ImageSlicer.zip
Usage is test.cmd "C:\Path\to\test" (or you should be able to just drag the test folder onto the test.cmd file in Windows Explorer)

In the script I am checking the %errorcode% and it appears to always be 0, even when ImageMagick crashes. Presumably this is because if ImageMagick crashes then it can't set an exit code, and errorcode contains the value from before ImageMagick was called?

I have tried adding a 1s timeout in the loop, but this didn't make any difference, so it doesn't seem like the script is calling ImageMagick too quickly in repetition to cause the error.

Since the error is intermittent, I'm not sure what the problem is, and since ImageMagick crashes rather than exiting with an error, I don't know how I could get any debug information on what might be causing the error?

Dave

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-24T18:51:10-07:00
by magick
Grab http://www.imagemagick.org/download/bin ... ws-dll.exe. We'll have a 64-bit version within a day or two. This release has a patch that fixes the problem you reported.

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-25T02:38:07-07:00
by LordOfTheStrings
I have the same problem on Windows 7 (64 Bit). Some image, most (but not only) TIFF, always cause a crash, while others cause it once but pass Image Magick without any problems in a second or third try. I call convert.exe from .NET via System.Diagnostics.Process.

Code: Select all

convert <in> -resize "640x480>" -profile "sRGB.icc" -colorspace "RGB" -quality 70 <out.jpg>
Profile is the one delivered with Image Magick.
Source files are tif, jpg, eps, png - where tif, eps and jpg are in cmyk colorspace most of the time.
Output is always jpg.

You can download an image that always causes a crash here: http://dl.dropbox.com/u/18526818/143656714_736.tif

The problem occurred with
ImageMagick-6.7.4-2-Q16-windows-dll.exe
ImageMagick-6.7.4-8-Q16-windows-dll.exe

Using version 6.7.4-9 is no solution for me, as this release tells me "no decode delegate for this image format" for all images i try to convert.

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-25T06:33:51-07:00
by magick
Oops. The TIFF coder modules was not included in the distribution. We'll release an update this evening.

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-25T06:52:56-07:00
by LordOfTheStrings
Cool! :lol: Thanks!

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-30T04:01:13-07:00
by djeyewater
Just tried the latest version ImageMagick-6.7.5-0-Q16-windows-x64-dll.exe but it is still crashing randomly for me.

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-30T05:36:50-07:00
by magick
The crash seems to come from the TIFF EXIF profile handler. Try -define tiff:exif-properties=false to ignore the EXIF profile. Does that resolve any crashes?

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-30T13:20:45-07:00
by djeyewater
No, unfortunately it still crashes when adding -define tiff:exif-properties=false to the command. I tried with JPEGs and they work fine, just seems to be these TIFFs. Maybe some non-standard tag added to TIFFs by Photoshop.

I tried using ImageMagick to strip the exif from the TIFFs, but it crashes. I thought maybe exiftool might be able to strip the exif instead, but reading the exiftool FAQ it seems it's not possible to easily strip the exif from TIFFs.

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-30T14:45:10-07:00
by magick
Do you have an image that reliably causes a crash? We need to reproduce the problem so we can debug and determine if the cause of failure is in ImageMagick or the TIFF delegate library.

Re: ImageMagick crashing randomly on Windows

Posted: 2012-01-30T15:19:58-07:00
by djeyewater
No, I'm afraid not. Sometimes the batch script will loop through and process all the images successfully, while other times it will crash quite a few times. Hopefully LordOfTheStrings is still monitoring this thread since he/she said they had some images that always cause a crash.

Re: ImageMagick crashing randomly on Windows

Posted: 2014-01-07T07:45:06-07:00
by macthinkdifferent
I appear to be having a similar issue. ImageMagick appears to be crashing whenever it is ran on Windows 7 or Windows 8 with certain TIFF files. I am currently running on ImageMagick 6.7.5-7 2012-02-23 If I run it on directly on the command line it will run, but if I run it through the .exe it will crash. This does not seem to occur on my Win 2012 install. I try running it in Verbose mode and it will just simply crash.

The TIFF files that are used to render this are created in Photoshop. However, it doesn't look like they have any radical information like layers or anything like that in them. They are simple TIFF files.

Any guidance would be much appreciated.

Re: ImageMagick crashing randomly on Windows

Posted: 2014-01-07T12:40:54-07:00
by snibgo
I don't understand "If I run it on directly on the command line it will run, but if I run it through the .exe it will crash." What .exe?

If you have a command that consistently crashes with a particular image, please post both. You can put the image somewhere like dropbox.com and paste the link here.

Re: ImageMagick crashing randomly on Windows

Posted: 2014-01-07T12:51:26-07:00
by dlemstra
We recently fixed a bug that only occurred with specific tiff images. This will be fixed in 6.8.8-2. If you can post a link to one of your images that crashes so I can test it with the latest beta.