Page 1 of 1

Resize command returns error code 141

Posted: 2011-10-12T12:29:10-07:00
by andanthor
I am getting an error code 141 while attempting to resize certain images, which is very confusing since according to IMs documentation (http://www.imagemagick.org/script/exception.php) error codes range from 300 to 800.

Does anyone have any information on Error Code 141 that can help me solve this blocking issue?

Some context:
  • ImageMagick was installed on an Amazon S3 instance via yum install ImageMagick
    ImageMagick is being invoked by my Scala code through the im4Java library (who claims the error codes are returned as-is from IM)
    The problematic images are also being cropped. I have tried cropping and resizing in one command, and cropping THEN resizing, with the same result (the resize fails, not the crop)
Thanks in advance,

Alejandro.

Re: Resize command returns error code 141

Posted: 2011-10-12T13:51:35-07:00
by fmw42
what is your exact command(s)

what version of IM are you using on what platform?

Re: Resize command returns error code 141

Posted: 2011-10-13T08:01:41-07:00
by andanthor
Hi, thanks for replying.

I'm using ImageMagick 6.5.4-7 on an Amazon S3 instance running Linux. ImageMagick was installed using YUM.

Code: Select all

>convert -version
Version: ImageMagick 6.5.4-7 2011-01-17 Q16 OpenMP http://www.imagemagick.org
I have tried different options according to the documentation, but in particular the following two fail with exactly the same error:

Code: Select all

convert -extract "1382x1382+173+0" -resize "75x75>" "${1}" -quality "75.0" - 
convert -crop "1382x1382+173+0" -resize "75x75>" "${1}" -quality "75.0" - 
Where "${1}" is the placeholder im4java uses for the input image.

I should mention that issuing a resize without the crop or extract options works with no problem. I only get the error code 141 when doing a crop or extract.

To add to my confusion, the problem seems to be intermitent. I have tried converting 30 images, and I get an error on file #20, only to retry the same set and get the process to fail on file #25 or #15. This leads me to rule out a problem with the source images.

Any ideas? In particular, Im interested in the meaning of error code 141, which is not documented on Image Magick's website.

Thanks again for any help you can offer,

Alejandro.

Re: Resize command returns error code 141

Posted: 2011-10-13T09:56:48-07:00
by fmw42
try proper IM 6 syntax with the input image first

convert "${1}"[1382x1382+173+0] -resize "75x75>" -quality "75.0" -
(no space between input image and subsection)

convert "${1}" -crop "1382x1382+173+0" +repage -resize "75x75>" -quality "75.0" -

(-extract can be used before or after the input image)

Otherwise, try in command line mode with a unique output image (rather than stdout) to see if it is a problem with your java. If it does not work in command line mode, then perhaps upgrade IM. Your version is rather old.

Post a link to one of your failing images, so others can test.

see http://www.imagemagick.org/Usage/basics/#why and http://www.imagemagick.org/script/comma ... essing.php


I don't know anything about IM error codes, but suspect it is coming from somewhere else.

Re: Resize command returns error code 141

Posted: 2011-10-19T07:21:19-07:00
by andanthor
Hi all, thank you for responding.

It seems the problem is somewhere in the im4java wrapper, specifically when capturing the output of the JNI call to ImageMagick.

The only solution that worked was saving the result in a temporary file and then loading it into a BufferedImage, instead of using im4java's ability to return a BufferedImage directly.

If you are curious about the details, I can provide some sample source code.

Cheers.

Re: Resize command returns error code 141

Posted: 2011-10-20T00:40:21-07:00
by anthony
Also try adding a -regard-warnings operational setting.
http://www.imagemagick.org/Usage/basics ... d-warnings

Re: Resize command returns error code 141

Posted: 2013-02-15T13:11:09-07:00
by ekang
Hi,
I got the same error, and I agree with you that it seems to be im4java wrapper issue.
Can you please post your solution to work around it?

Thanks!