Hello,
I am trying to use the following command for making a simple thumbnail for uploads. Needs to work on PDF, JPG, GIF, and PNG...the output format is always a JPG. I'm using PHP. This code works perfect on my laptop environment but fails on live server.
The error I'm getting is: cannot create -flatten: Permission denied.
exec("/usr/bin/convert \"{$filepath}[0]\" -background white -resize {$resize} -flatten -alpha remove $thumbTemp 2>&1",$out,$return);
Any ideas??
James
Getting errors on live server, not on dev using -Flatten and -Alpha
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Getting errors on live server, not on dev using -Flatten and -Alpha
What are your IM versions and platforms?
Is it possible that your $resize is empty? Check your variable values.
I do not use PHP that much. Are your arguments from PHP or unix variables. why the braces { ... }?
Please always provide your IM version and platform when asking questions in the future.
Is it possible that your $resize is empty? Check your variable values.
I do not use PHP that much. Are your arguments from PHP or unix variables. why the braces { ... }?
Please always provide your IM version and platform when asking questions in the future.
Re: Getting errors on live server, not on dev using -Flatten and -Alpha
SOLVED: I have two different Image magick versions on dev(7.0.1)and live. The live version is older(6.7), and does not like the carat in my $resize variable.
When I remove the carat it works. My resize variable was as follows:
$resize = '120x160>';
I will just update version on live to match. Should work.
When I remove the carat it works. My resize variable was as follows:
$resize = '120x160>';
I will just update version on live to match. Should work.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Getting errors on live server, not on dev using -Flatten and -Alpha
The ^ symbol has been around for a while. It should have worked. How was it expressed? Perhaps a bug in your 6.7 version.
From the changelog:
2008-01-24 6.3.8-2 Cristy <quetzlzacatenango@image...>
Support a ^ meta character in an image geometry (.e.g convert 640x480.png -resize 240^ returns a 320x240 result).
From the changelog:
2008-01-24 6.3.8-2 Cristy <quetzlzacatenango@image...>
Support a ^ meta character in an image geometry (.e.g convert 640x480.png -resize 240^ returns a 320x240 result).