Page 1 of 1

resizing stop working after updating imagemagick

Posted: 2015-05-15T01:51:44-07:00
by fhardijanto
Hi,

We've recently updated ImageMagick to version 6.7.9-1, and since then our batch job (which hasn't been changed) has stopped working properly because ImageMagick seems to keep crashing. The strange thing is that it sometimes works once, but the next job crashes again. We've tried to try the command via the command line and it works, so we don't know what could have gone wrong.
We work with a Linux machine running on RHEL6.

This is the error we got:

Error executing process /usr/bin/convert "/usr/local/tomcat/instances/deinstance/temp/images.jpg" -resize 80x70 -unsharp 1.5x1.0+1.0+0.00784 -size 80x70 xc:#fff +swap -gravity center -composite "/var/www/html/imagefolder/resized-image.jpg": 000000 fd:04 18363 /usr/lib64/libMagickCore.so.2.0.0
7fcf85726000-7fcf85926000 ---p 001ce000 fd:04 18363 /usr/lib64/libMagickCore.so.2.0.0
7fcf85926000-7fcf85977000 rw-p 001ce000 fd:04 18363 /usr/lib64/libMagickCore.so.2.0.0
7fcf85977000-7fcf85990000 rw-p 00000000 00:00 0
7fcf85993000-7fcf8599a000 r--s 00000000 fd:04 313 /usr/lib64/gconv/gconv-modules.cache
7fcf8599a000-7fcf8599b000 rw-p 00000000 00:00 0
7fff260fb000-7fff26113000 rw-p 00000000 00:00 0 [stack]
7fff261ff000-7fff26200000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

Any help or pointer where we should look for the cause will be very much appreciated.

Re: resizing stop working after updating imagemagick

Posted: 2015-05-15T09:22:00-07:00
by fmw42
6.7.9.1 is still over 200 versions old. If you upgraded to that version, why not upgrade to the current version 6.9.1.2. Around the time of 6.7.9.1 IM was undergoing some radical changes. So there might have been bugs in that release. See viewtopic.php?f=4&t=21269

try putting double quotes around " #fff as xc:"#fff" or just use white as xc:white

Re: resizing stop working after updating imagemagick

Posted: 2015-05-29T00:37:43-07:00
by fhardijanto
Hi,

Sorry to get back so late. I was first out of office and then it took some time to test.

I've now changed the command to xc:white, and it does seem to work better. Thanks for the suggestion, Fred.

It's still unstable though, and sometimes the job hangs without throwing an error. After a restart it will then work again.

We use this version because this is the supported version by RHEL6. We've created a ticket to request an update, but until that happens, I'm afraid we're stuck in this unstable release.

Re: resizing stop working after updating imagemagick

Posted: 2015-05-29T02:42:48-07:00
by Bonzo
What happens if you use -extent as I assume you are putting your resized image onto a white background:

Code: Select all

/usr/bin/convert "/usr/local/tomcat/instances/deinstance/temp/images.jpg" -resize 80x70 -unsharp 1.5x1.0+1.0+0.00784 -background #fff -gravity center -extent 80x70 "/var/www/html/imagefolder/resized-image.jpg": 000000 fd:04

Re: resizing stop working after updating imagemagick

Posted: 2015-06-04T02:52:09-07:00
by fhardijanto
We have upgraded to version 6.9.1-4.
The job has been working great, until it has to resize an image with a CMYK colorspace (instead of sRGB) and transparent background.
Is ImageMagick unable to process this type of image?

FYI, we're still using the original commands (we resize to different formats). This was the command that hanged:

/usr/bin/convert "/usr/local/tomcat/instances/deinstance/temp/images.jpg" -resize 320x480 -unsharp 0.5x1.0+0.8+0.0784 -size 320x480 xc:white +swap -gravity center -composite "/var/www/html/imagefolder/resized-image.jpg"

Re: resizing stop working after updating imagemagick

Posted: 2015-06-04T03:17:56-07:00
by dlemstra
Can you add a link to the file that causes this issue?

Re: resizing stop working after updating imagemagick

Posted: 2015-06-04T03:18:38-07:00
by snibgo
If you publish your input CMYK file images.jpg, someone might take a look.

I think using "-composite" on images of different colorspaces will end badly, although it shouldn't hang.

Re: resizing stop working after updating imagemagick

Posted: 2015-06-04T05:02:07-07:00
by fhardijanto
The image:
Image

Re: resizing stop working after updating imagemagick

Posted: 2015-06-04T05:11:54-07:00
by snibgo
The command doesn't hang for me, IM v6.9.1-0 on Windows 8.1.

"-composite" should have both images of the same type, either RGB or CMYK. For eaxmple, to make them CMYK:

Code: Select all

convert testc.jpg -resize 320x480 -unsharp 0.5x1.0+0.8+0.0784 -size 320x480 ( xc:white -colorspace CMYK ) +swap -gravity center -composite x.jpg