Response code 1? Is it really and error?

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
ridera

Response code 1? Is it really and error?

Post by ridera »

I get a response code "1" from

Code: Select all

exe(convert "lap15mrp.jpg -resize 640x854 -colors 100 -quality 90 -filter Mitchell -unsharp 0 png8:lap15mrp.gif")
What little info I can find about response codes indicates I should be getting "0"

I can force errors and get other values.

Does the "1" mean I have an error?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

A return code from the convert program of zero means success, anything else is an error. Make sure the return code is coming from the convert program. Try adding -debug all to see if any exceptions are thrown.
ridera

Post by ridera »

Found the suspects, have no idea if they are meaningful:


[154] => 15:01:25 0:01 0.600u 6.2.6 Exception convert[27190]: blob.c/OpenBlob/2085/Exception
[155] => unable to open image `x': No such file or directory
[156] => 15:01:25 0:01 0.600u 6.2.6 Cache convert[27190]: cache.c/DestroyCacheInfo/1760/Cache
[157] => destroy
[158] => 15:01:25 0:01 0.610u 6.2.6 Exception convert[27190]: blob.c/OpenBlob/2085/Exception
[159] => unable to open image `1200': No such file or directory
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

The debugging output tells us that the convert program is getting something other than the command line you sent it. Its getting an 'x' and '1200'. You'll need to determine why that is being passed to the convert program.
ridera

Post by ridera »

I found the problem, hope this helps someone else

I thought the "x" and "1200" looked familiar.

My command was written as:
-resize $width x $height [$height is 1200]

Solution was obvious

-resize {$width}x{$height}

All's well that ends well. It's a wonder the command worked.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

In ImageMagick 6.2.6-7 Beta we added a new log statement to display the actual command line being passed to the convert program to make debugging situations like yours easier. All you need to do is add -debug configure to the command line to get this information (and of course use ImageMagick 6.2.6-7 or above). The patch will be available by tommorrow.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

You need something like -debug all, you have -debug followed by e a file name.
Post Reply