[Bug 1641307] Re: GD function imagecropauto() missbehaiv in Ubuntu
Launchpad Bug Tracker
1641307 at bugs.launchpad.net
Mon Mar 26 18:51:44 UTC 2018
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: apport (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1641307
Title:
GD function imagecropauto() misbehaves in Ubuntu
Status in apport package in Ubuntu:
Confirmed
Bug description:
When croptting images with the php function imagecropauto(), the
returned image is no longer transparant.
Using the same code in Gentoo gives expected result.
Example Code:
<?php
// Create a 300x300px transparant image with a 100px wide red circle in the middle
$i = imagecreatetruecolor(300, 300);
imagealphablending($i, FALSE);
imagesavealpha($i, TRUE);
$transparant = imagecolorallocatealpha($i, 0xDD, 0xDD, 0xDD, 0x7F);
imagecolortransparent($i, $transparant);
imagefill($i, 0, 0, $transparant);
$red = imagecolorallocate($i, 0xFF, 0x0, 0x0);
imagefilledellipse($i, 150, 150, 100, 100, $red);
imagepng($i, "red_300.png");
// Crop away transparant parts and save
$i2 = imagecropauto($i, IMG_CROP_TRANSPARENT);
imagepng($i2, "red_crop_trans.png");
imagedestroy($i2);
// clean up org image
imagedestroy($i);
Expected result:
* red_300.png: 300x300px, transparant with a 100x100px red circle
* red_crop_trans.png: 100x100px, transparant with a 100x100px red circle
Ubuntu Result:
* red_300.png: 300x300px, transparant with a 101x101px red circle
* red_crop_trans.png: 101x101px, black with a 101x101px red circle
Gentoo result:
* red_300.png: 300x300px, transparant with a 101x101px red circle
* red_crop_trans.png: 101x101px, transparant with a 101x101px red circle
Ubuntu versions:
lsb_release -d -> 'Ubuntu 16.10'
php -v -> 'PHP 7.0.8-3ubuntu3'
apt-cache show php-gd > '1:7.0+44'
apt-cache show php7.0-gd -> '7.0.8-3ubuntu3'
apt-cache show libgd3 -> '2.2.1-1ubuntu3.2', '2.2.1-1ubuntu3'
uname -r -> '4.8.0-26-generic'
Gentoo versions:
uname -r -> '4.1.12-gentoo'
php -v -> 'PHP 5.6.26-pl0-gentoo'
equery list gd -> 'media-libs/gd-2.1.1-r1'
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1641307/+subscriptions
More information about the foundations-bugs
mailing list