ImageMagick EXEC return value in negative

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
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

ImageMagick EXEC return value in negative

Post by agriz »

Code: Select all

exec("convert \( *-1.png +append -flatten  \)   \( *-2.png +append -flatten \)  \( *-3.png +append -flatten \) +append output.png 2>&1", $output, $return);
//edit
//previous one was working.
//This one is causing problem.
//Approximately, about 70 images to be loaded. But throwing that negative number and there is no ouput.

Code: Select all


$output 
Array
(
)

$return
-1073740791
What does the negative number mean?
If i add just two images it works.

Version : 7.0.2
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick EXEC return value in negative

Post by fmw42 »

I do not know what that return value is. Probably not coming from IM, but from exec().

If on IM 7, replace convert with magick. Does that help?

How big are your image? 70 images is a lot to hold in memory. Have tried with just a few images? Perhaps your tmp directory is getting too full?
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: ImageMagick EXEC return value in negative

Post by agriz »

Few Images works. Tmp directory works. If i join the command to single command, it fails.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick EXEC return value in negative

Post by fmw42 »

You are either running out of memory or tmp space.
If i join the command to single command, it fails.
Sorry I do not know what this means.
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: ImageMagick EXEC return value in negative

Post by agriz »

Code: Select all


exec("convert \( *-1.png +append -flatten  \)   \( *-2.png +append -flatten \)  \( *-3.png +append -flatten \) +append output.png 2>&1", $output, $return);
This is the single command. It fails


convert \( *-1.png +append -flatten  \)  tmp_1.png
convert \( *-2.png +append -flatten  \)  tmp_2.png
convert \( *-3.png +append -flatten  \)  tmp_3.png

convert tmp_1.png tmp_2.png tmp_3.png + append output.png

Multiple command and It works.

This two method produce the same output. Is there any performance difference?
In the first command, the temp images are not stored in disk. Where are they stored?

\( *-1.png +append -flatten \) - where is the result of this line stored?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick EXEC return value in negative

Post by fmw42 »

Your first command is run via PHP exec()? Did you run your separate commands via PHP exec(). If not, then PHP may have limits set on memory usage that you do not get otherwise.

Performance would be slower with separate commands since you have to write and then read the tmps.
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: ImageMagick EXEC return value in negative

Post by agriz »

I will try to change the memory limit of php and let you know sir
Post Reply