Newbie here needs help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Newbie here needs help

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
stingerman

Re: Newbie here needs help

Post 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:

Code: Select all

PNG:-";
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. :(
stingerman

Re: Newbie here needs help

Post by stingerman »

Post Reply