New Addon: SimpleImageFixBlackBackgrounds

This addon is for edge cases, if you have problems with black backgrounds of transparent png and gif thumbnails.

Screenshot

These example images should have transparent backgrounds, but they are black:

Addon

Description

This is a modified version of the SimpleImage library by Raffael Jesche.

On some hosts, transparent png and gif files lose their transparency and the background turns black.

After multiple days of digging through the code, reading about GD and doing a lot of tests, I’m pretty sure, that the problem comes from differences between bundled and non-bundled PHP/GD versions.

I fixed the problem with black backgrounds after cropping/resizing images, but this library doesn’t work with filters anymore.

This library is written to replace the original library in Cockpit CMS, that displays black backgrounds for thumbnails on some hosts. It will only get active, if (GD_BUNDLED === 0).

I wasn’t able to test it on different hosts with non-bundled GD. My test scenario was on an Uberspace 7 (CentOS 7, PHP 7+), which uses a non-bundled GD version.

If you also have problems with black backgounds, than my fix might work for you.

Source, Discussion, related issue