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.
Newbie here needs help
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Newbie here needs help
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Newbie here needs help
I am not getting any image outputted from this. Do I need to put in: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); ?>
Code: Select all
PNG:-";
Code: Select all
header("Content-type: image/jpeg");
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);
?>