Strange problem : cron vs browser

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
skyg
Posts: 2
Joined: 2011-04-13T01:20:10-07:00
Authentication code: 8675308

Strange problem : cron vs browser

Post by skyg »

Hello

OS : CentOS 5.5 64b
IM Version : ImageMagick 6.6.8-6 2011-04-08 Q16
GS version : GPL Ghostscript 9.02 (2011-03-30)

Im using IM and GS for a file managing systeme with thumbs for some file formats like jpg, png, eps, etc...

My code worked fine untill a change to a new server, i cant figure this ptoblem out.

My code works fine wen i call the script via a web browser, but wen i try the cron, it only works with jpg and png files.

I suppose its something to do with GS because this problem is with EPS and PDF files and GS is the delegate (is that right ?)

Here is the line that converts a PDF file :

Code: Select all

/usr/local/bin/convert -colorspace RGB -quality 90 -density 80 /home/full/path/to/file.pdf -thumbnail 55 /home/full/path/to/file.jpg
The exat PHP code :

Code: Select all

$commande = "/usr/local/bin/convert -colorspace RGB -quality 90 -density 80 ".$filePath.$TheFileName." -thumbnail 55 ".$filePathCache.$cacheFileName;
exec($commande, $output, $debug); 
I debugged the PHP variables, and all is ok, even wen called from cron.

I repeat, this code works fine if i test my cron script via a web browser, but fails without any error if used by the cron system itself.

I tested the users privileges via SSH and it worked fine wen using that same command.

Is there some way to specifie where GS is wen calling convert ?

Thanks for any ideas !

Just ask for any information you might think is important.

Sky
skyg
Posts: 2
Joined: 2011-04-13T01:20:10-07:00
Authentication code: 8675308

Re: Strange problem : cron vs browser

Post by skyg »

For information, this is the information i get from the php variables :
output: --nostringval-- --nostringval-- --nostringval--
debug:0:CRIT: rangecheck in .setuserparams;1:Operand stack:;2: --nostringval-- --nostringval-- --nostringval--;
I suppose this is just the end of teh error generated, no idea how to get more.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Strange problem : cron vs browser

Post by anthony »

Cron typically has even less of an environment setup that the web server!
The script that cron calls need to ensure the PATH and other environment has been fully defined for what you want it to do.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply