Quality decrease in libgd3

Asked by Ewald Stangl

Hello,

I use GD for resizing/branding images in PHP.
Everything worked fine with libgd3 <= 2.1.1-4build2

Since libgd3=2.1.1-4ubuntu0.16.04.5 there is a strange behavior when resizing transparent images with imagecopyresampled and putting them on a background.
A simple code example:

<?php
$outImage = imagecreatetruecolor(200, 200);

$color = imagecolorallocate($outImage, 233, 224, 218);
imagefilledrectangle($outImage, 0, 0, imagesx($outImage), imagesy($outImage), $color);

$im = imagecreatefrompng('https://www.expert24.com/200x.png');

imagecopyresampled($outImage, $im, 50, 25, 0, 0, imagesx($outImage) - 100, imagesy($outImage) - 50, imagesx($im), imagesy($im));
?>

With 2.1.1-4build2 everything looks fine but with newer versions there are stripes of a little darker color in the area of the transparent pixels of the overlayed image.

The version of php-gd or the php version itself (5.6, 7.0 from main or ondrej-ppa) doesn't have any influence.

The ubuntu changelog only says that there were some security fixes.

Is there a workaround?

regards
Ewald Stangl

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

Can you help with this problem?

Provide an answer of your own, or ask Ewald Stangl for more information if necessary.

To post a message you must log in.