resizing stop working after updating imagemagick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
fhardijanto
Posts: 4
Joined: 2015-05-15T01:40:26-07:00
Authentication code: 6789

resizing stop working after updating imagemagick

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: resizing stop working after updating imagemagick

Post 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
fhardijanto
Posts: 4
Joined: 2015-05-15T01:40:26-07:00
Authentication code: 6789

Re: resizing stop working after updating imagemagick

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: resizing stop working after updating imagemagick

Post 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
fhardijanto
Posts: 4
Joined: 2015-05-15T01:40:26-07:00
Authentication code: 6789

Re: resizing stop working after updating imagemagick

Post 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"
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: resizing stop working after updating imagemagick

Post by dlemstra »

Can you add a link to the file that causes this issue?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: resizing stop working after updating imagemagick

Post 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.
snibgo's IM pages: im.snibgo.com
fhardijanto
Posts: 4
Joined: 2015-05-15T01:40:26-07:00
Authentication code: 6789

Re: resizing stop working after updating imagemagick

Post by fhardijanto »

The image:
Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: resizing stop working after updating imagemagick

Post 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
snibgo's IM pages: im.snibgo.com
Post Reply