Optimizetransparency - 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
HaZzard

Optimizetransparency - PHP

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Optimizetransparency - PHP

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

Re: Optimizetransparency - PHP

Post 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;
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Optimizetransparency - PHP

Post 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;
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Optimizetransparency - PHP

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

Re: Optimizetransparency - PHP

Post by HaZzard »

Hey,
i used Version Command and it returns:

Code: Select all

Version: ImageMagick 6.2.4 02/10/07
is this ok!?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Optimizetransparency - PHP

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