Page 1 of 1

Optimizetransparency - PHP

Posted: 2008-08-20T01:46:36-07:00
by HaZzard
Hey,

I trying to use "convert "test.gif" -layers Optimizetransparency"
with PHP but it doesn't work and no error returns!

any help would be appreciated!

Best Regards, Asac

Re: Optimizetransparency - PHP

Posted: 2008-08-20T21:54:49-07:00
by anthony
You don't give an output file name to start with. so the argument to -layers will be the output filename, which means -layers will error with a 'missing argument'

Change your PHP code so you can see the output of standard error, and confirm the diagnosis.

Re: Optimizetransparency - PHP

Posted: 2008-08-21T01:32:41-07:00
by HaZzard
Hey,
Ive changed my Parameter String!
So at the moment it looks like this:

Code: Select all

convert convert/tmpCacheFolder/08-17-0874494615output.gif -layers optimizetransparency convert/tmpCacheFolder/test.gif
but there is no error and it doesn't work :/

PHP Code:

Code: Select all

function compress($file)
{
$convert = 'convert '.$file.' -layers optimizetransparency convert/tmpCacheFolder/test.gif';
$return = system($convert, $retval);

return $return;

Re: Optimizetransparency - PHP

Posted: 2008-08-21T02:33:38-07:00
by Bonzo
If it does not work try a simple version first - the file in the same folder as the code and not in a function. This will prove if the code is OK and you can expand it into a function when you get it to work.

I do not need the '.$file.' written like that try this:

Code: Select all

function compress($file)
{
$convert = 'convert $file -layers optimizetransparency convert/tmpCacheFolder/test.gif';
$return = system($convert, $retval);

return $return;

Re: Optimizetransparency - PHP

Posted: 2008-08-21T03:10:03-07:00
by anthony
Whar version of IM is it? Optimize Transparency was added to Version 6.3.3-4 for releases after 28 March 2007. Many websites do not have a new enough version.

Check the Rubble Web website for methods to get the errors which is probably getting recorded into the web servers error log, which is not normall visible to web client, only to the web administrator. If it is not working there should be some sort of error, even if it is a simple 'unable to write'.

Re: Optimizetransparency - PHP

Posted: 2008-08-21T03:13:57-07:00
by HaZzard
Hey,
i used Version Command and it returns:

Code: Select all

Version: ImageMagick 6.2.4 02/10/07
is this ok!?

Re: Optimizetransparency - PHP

Posted: 2008-08-21T03:43:42-07:00
by Bonzo
No you have version 6.2.4 and Anthony says you need at least 6.3.3-4 The latest version is 6.4.3-1