User tests: Successful: Unsuccessful:
This code is IMO unnecessary, as it is called again in resize method. More over it is strange to modify image upon loading it. Issue raised here #7655
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.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Libraries |
@n3t this will be committed when:
So my advice is make very clear and simple test instructions so testers can follow then to test without spending much time trying to understand how to test..
example: #9690
Remember: there are almost 400 open PR an few volunteers are willing to do tests.
@n3t I would test this if I knew how to
@andrepereiradasilva @brianteeman Sorry for late reply, I was quite busy.
Test instructions:
1/ Install attached package: issue7658.zip
2/ Make sure your tmp folder is writable
3/ execute CLI script test_issue_7658.php
4/ See your tmp folder for results (issue7658.trans.png, issue7658.nontrans.png and issue7658.jpg)
5/ Apply this patch and execute the CLi again
6/ See the results again and comapre mainly transparent PNG (issue7658.trans.png)
7/ Uninstall issue7658 package and purge your tmp folder
I have tested this item successfully on ee18e8b
Thanks for the detailed test instructions - made it really easy to confirm the issue and your fix
Easy | No | ⇒ | Yes |
I have tested this item successfully on ee18e8b
As test in last comment
Status | Pending | ⇒ | Ready to Commit |
RTC
See what happens when you have good testing information :)
Labels |
Added:
?
|
Milestone |
Added: |
Thank you guys, next time I will get better with testing instructions from the beginning :-)
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-04-14 21:28:56 |
Closed_By | ⇒ | rdeutz |
Labels |
Removed:
?
|
Milestone |
Removed: |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
Any chance to get this commited? Current results of resizing transparent images are terrible looking.