Share » Forums » Developer » PNG image resize loose transparency

PNG image resize loose transparency

PNG image resize loose transparency

Monday 06 July 2009 4:39:35 am - 4 replies

Modified on Monday 06 July 2009 4:40:52 am by Olivier Versanne

Author Message

André R.

Monday 06 July 2009 5:24:25 am

This is controlled by image.ini settings, and if ImageMagic is not used (as in GD is used instead), you can see that in settings/override/image.ini.append.php with content like this:

[ImageMagick]
IsEnabled=false

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Olivier Versanne

Monday 13 July 2009 4:24:23 am

Thanks!

Vytautas Germanavičius

Thursday 08 October 2009 4:52:09 am

after i switched to gd i lost transparency on all png images.

Has anyone solution for this?

i filled issue:
http://issues.ez.no/IssueView.php?Id=15640&activeItem=1

{set-block scope=root variable=cache_ttl}0{/set-block}

Vytautas Germanavičius

Friday 17 June 2011 8:22:21 am

This message gave me idea
http://stackoverflow.com/questions/32243/can-png-image-transparency-be-preserved-when-using-phps-gdlib-imagecopyresampled

And i made small changes in ezimagegdhandler.php:
i added

    imagealphablending( $temporaryImageObject, false );    imagesavealpha( $temporaryImageObject, true );

after

       $temporaryImageObject = eZImageGDHandler::imageCreate( $destinationWidth, $destinationHeight, eZImageGDHandler::isImageTrueColor( $imageObject, $sourceMimeData ) );

It saves PNG transparency before resizing.

I made patch, if someone is interested. http://issues.ez.no/IssueView.php?Id=15640&activeItem=1

{set-block scope=root variable=cache_ttl}0{/set-block}

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu