Joomla 3.x introduced some changes to JImage class which influence quality of resized PNGs with transparency. To demonstrate it see this images:
Test code to resize is
$original = new JImage($src);
$original->resize(140,140,false, JImage::SCALE_INSIDE);
$original->toFile($dest,IMAGETYPE_PNG);
Tested on PHP 5.3.29 with GD 2.1.0 compatible, libPNG 1.6.12
and on PHP 5.5.27 with GD 2.1.0 compatible, libPNG 1.2.49
this behavior is caused by setting explicitly transparent color in loadFile method. For some reason isTransparent() returns false in this case, so transparent color is set explicitly causing the image look like that.
I am not sure why this code is at this place (loading image), as it seems to solve black background issue, when SCALE_FIT is used on resizing. However in resize method it is introduced again.
Please submit that as a pull request
Closing this issue since we have a PR.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-08-08 11:18:35 |
Closed_By | ⇒ | Bakual |
Labels |
Added:
?
|
This patch solves the issue
n3t@6755fdf