? Success

User tests: Successful: Unsuccessful:

avatar n3t
n3t
8 Aug 2015

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:

Original
test

Resized in Joomla 2.5
j25

Resized in Joomla 3
j30

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.

avatar n3t n3t - open - 8 Aug 2015
avatar n3t n3t - change - 8 Aug 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 9 Aug 2015
Category Libraries
avatar n3t
n3t - comment - 2 Apr 2016

Any chance to get this commited? Current results of resizing transparent images are terrible looking.

avatar andrepereiradasilva
andrepereiradasilva - comment - 2 Apr 2016

@n3t this will be committed when:

  • if has two successful tests.
  • after the two successful tests will be labeled as RTC and the maintains decide in which version it should be merged (in the current case 3.5.x or 3.6).

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.

avatar brianteeman
brianteeman - comment - 13 Apr 2016

@n3t I would test this if I knew how to


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7658.

avatar n3t
n3t - comment - 13 Apr 2016

@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

avatar brianteeman brianteeman - test_item - 14 Apr 2016 - Tested successfully
avatar brianteeman
brianteeman - comment - 14 Apr 2016

I have tested this item :white_check_mark: successfully on ee18e8b

Thanks for the detailed test instructions - made it really easy to confirm the issue and your fix


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7658.

avatar brianteeman brianteeman - change - 14 Apr 2016
Easy No Yes
avatar andrepereiradasilva
andrepereiradasilva - comment - 14 Apr 2016

Followed test instructions and the difference in issue7658.nontrans.png is clear:

Before:
issue7658 nontrans

After:
issue7658 nontrans

avatar andrepereiradasilva andrepereiradasilva - test_item - 14 Apr 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 14 Apr 2016

I have tested this item :white_check_mark: successfully on ee18e8b

As test in last comment


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7658.

avatar brianteeman brianteeman - change - 14 Apr 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 14 Apr 2016

RTC

See what happens when you have good testing information :)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7658.

avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 14 Apr 2016
Milestone Added:
avatar n3t
n3t - comment - 14 Apr 2016

Thank you guys, next time I will get better with testing instructions from the beginning :-)

avatar rdeutz rdeutz - change - 14 Apr 2016
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
avatar rdeutz rdeutz - close - 14 Apr 2016
avatar rdeutz rdeutz - merge - 14 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 14 Apr 2016
avatar rdeutz rdeutz - reference | c4f7766 - 14 Apr 16
avatar rdeutz rdeutz - merge - 14 Apr 2016
avatar rdeutz rdeutz - close - 14 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2016
Labels Removed: ?
avatar n3t n3t - head_ref_deleted - 14 Apr 2016
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:

Add a Comment

Login with GitHub to post a comment