Newbie trying to use convert in php

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?".
Post Reply
lvanderb

Newbie trying to use convert in php

Post by lvanderb »

I'm trying to create a gif from a jpg, thumbnail it and make the white transparent.

I've been reading the forums 'til my eyes were buggy... finally saw about debug all and verbose so I have a wee bit of output

Here's my code:

Code: Select all

//$src is passed to the function
$new_src = strrev( strchr(strrev($src),'.') ) . "gif";
$exec_stmt = "/usr/bin/convert ".$src." -fuzz 10% -debug all -verbose -quality 95 -resize ".$width." -transparency white ".$new_src;
$ret_val = exec("$exec_stmt");
if ($ret_val ||(!file_exists($new_src)) ) return $ret_val.'-'.$exec_stmt;
Here's a sample of my output :

Code: Select all

 destroy modules/catalog/images/tn-flsalpine.jpg[0]-/usr/bin/convert modules/catalog/images/tn-flsalpine.jpg -fuzz 10% -debug all -verbose -quality 95 -resize 100 -transparency white modules/catalog/images/tn-flsalpine.gif
destroy modules/catalog/images/abrun.jpg[0]-/usr/bin/convert modules/catalog/images/abrun.jpg -fuzz 10% -debug all -verbose -quality 95 -resize 100 -transparency white modules/catalog/images/abrun.gif
destroy modules/catalog/images/fls-ig3215.jpg[0]-/usr/bin/convert modules/catalog/images/fls-ig3215.jpg -fuzz 10% -debug all -verbose -quality 95 -resize 100 -transparency white modules/catalog/images/fls-ig3215.gif
destroy modules/catalog/images/konini.jpg[0]-/usr/bin/convert modules/catalog/images/konini.jpg -fuzz 10% -debug all -verbose -quality 95 -resize 100 -transparency white modules/catalog/images/konini.gif
destroy
Basically the debug info I'm getting is just
destroy $src[0]

Any suggestions? help?

Thanks,
Linda
lvanderb

Post by lvanderb »

:oops: spelled the transparent option incorrectly

All fixed now

Linda
Post Reply