Hi,
I have this img
https://docs.google.com/leaf?id=0B4Zy8e ... y=CI6I09MM
When calling from command bellow line is working ok.
convert a.jpg -resize 420x420 b.jpg
When calling via php
exec("convert a.jpg -resize 420x420 b.jpg") is not working. Is crashing with OutOfMemory
If I call from php
exec("convert a1.jpg -resize 420x420 b.jpg") and a1 is generated from command line with
convert a.jpg a1.jpg is working ok.
Can anyone tell me what is wrong with this image and also if there is a workaround for bellow issue to have same result with php ?
Thank You
Cristi
php and convert problem with some images
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: php and convert problem with some images
PHP is a different environment, with different command PATH, called in a different directory, and sometimes by a different user.
See IM Examples, APIs, PHP
http://www.imagemagick.org/Usage/api/#php
See IM Examples, APIs, PHP
http://www.imagemagick.org/Usage/api/#php
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: php and convert problem with some images
Hi,
Thank you for replay. I tried some new stuff I learned from the link you gave but still is not working.
Other images with same command, bigger or smaller than this are working, just few images are not working.
In php error log I see
"convert: Insufficient memory (case 4) `tarr.jpg'. convert: missing an image filename `tarr1.jpg'. "
Thank you,
Cristi
Thank you for replay. I tried some new stuff I learned from the link you gave but still is not working.
Other images with same command, bigger or smaller than this are working, just few images are not working.
In php error log I see
"convert: Insufficient memory (case 4) `tarr.jpg'. convert: missing an image filename `tarr1.jpg'. "
Thank you,
Cristi
Re: php and convert problem with some images
Why when I look at the image on your link using IE, firefox, chrome ( gave up with Safari as it would not even load the page ) is there just a blank page?
When I download it I can see it on my PC!
I can convert it OK using a localhost on my PC but again it will not show up in my browser but I can see it in the folder.
I would say that there is a problem with a the image and b your php setup.
Try running my code and see waht you get - compair the image information output with an image that is OK.
When I download it I can see it on my PC!
I can convert it OK using a localhost on my PC but again it will not show up in my browser but I can see it in the folder.
Code: Select all
<?php
$array=array();
echo "<pre>";
system("identify -verbose a.jpg" );
exec("convert a.jpg -resize 420x420 b.jpg 2>&1", $array);
echo "<br>".print_r($array)."<br>";
echo "</pre>";
?>
<img src="b.jpg">
Try running my code and see waht you get - compair the image information output with an image that is OK.