Page 3 of 3
Re: Newbie here needs help
Posted: 2009-01-20T18:27:22-07:00
by anthony
For converting UNIX command line shell IM Commands to PHP equivelents
See Im Examples, API's and Scripting, PHP
http://www.imagemagick.org/Usage/api/#php
I specifically recommend you follow the line separation technique
as keeping the 'logical' image processing steps to separate lines
make it a lot easier of you and others to read and understand the command.
Re: Newbie here needs help
Posted: 2009-03-09T22:39:06-07:00
by stingerman
Bonzo wrote:My code was to save an image to do what you want try this:
Code: Select all
<?php
$photo = $_GET['p'];
$height = $_GET['h'];
$width = $_GET['w'];
$cmd = "/usr/local/bin/convert $photo -matte -resize {$width}x{$height} \( +clone -background black -shadow 90x3+15+15 \) +swap -gravity northwest
-geometry -3-3 -composite -background white -flatten +repage ";
passthru($cmd, $retval);
?>
I am not getting any image outputted from this. Do I need to put in:
and:
Code: Select all
header("Content-type: image/jpeg");
somehow? Like the original:
Code: Select all
<?php
$photo = $_GET['p'];
$height = $_GET['h'];
$width = $_GET['w'];
$cmd = "/usr/local/bin/convert -size {$width}x{$height} $photo -matte -thumbnail {$width}x{$height} PNG:-";
header("Content-type: image/png");
passthru($cmd, $retval);
?>
I also changed the output to a PNG because of the shadow. Thanks again. I can't make heads or tails from those tutorials.
Re: Newbie here needs help
Posted: 2009-04-01T23:22:37-07:00
by stingerman