? Language Change Documentation Required PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar obuisard
obuisard
22 Sep 2022

Summary of Changes

This Pull Request is for issue #36533 [Solves no 2 of the 3 reported problems, the thumbs] and is a rewrite for #36552 created by @dgrammatiko.

Please refer to the original PR if you want to follow the discussions about the implementation.

The general idea is that image thumbnails are created in the Media Manager and those thumbnails are cached, increasing performance especially when a large amount of images is processed.

The thumbnail creation is 'off' by default.

Testing Instructions

Go to the FileSystem - Local plugin and set 'Create thumbnails' to 'Yes' on the 'images' folder.

Actual result BEFORE applying this Pull Request

The media manager loads full size images.

Expected result AFTER applying this Pull Request

The media manager loads a thumbnail image (max width or height of 200px).

Link to documentations

Please select:

avatar obuisard obuisard - open - 22 Sep 2022
avatar obuisard obuisard - change - 22 Sep 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2022
Category Administration Language & Strings Libraries Front End Plugins Unit Tests
avatar obuisard obuisard - change - 22 Sep 2022
Labels Added: ? Language Change PR-4.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2022
Category Administration Language & Strings Libraries Front End Plugins Unit Tests Administration Language & Strings Libraries Front End Plugins
avatar obuisard obuisard - change - 23 Sep 2022
Labels Removed: ?
avatar obuisard
obuisard - comment - 24 Sep 2022

tests/Codeception/api/com_media/MediaCest.php needs to be updated and fails at this point.

avatar dgrammatiko
dgrammatiko - comment - 11 Oct 2022

Hey, @obuisard I can't reply on #38722 as Nik has blocked me so I'll write my comment here:

  • when I asked you to resurrect this PR I meant to fork it and patch the things that other were asking me to change in the original PR and also fix the failing tests
  • About the other PR: the approach on that PR is wrong in the sense that you need a data structure that holds all related info per supported media file (mime type, has preview, allows edit, etc). If the project ends up with different inputs for each of all these required data you end up with countless inputs which makes the app really hard to configure and finally use it to its full extend. Mind that since Media manager supports audio and video and other types at some point you might want to provide edit for those (I had a trim plugin for audio and video). Also one more thing: uploads should only allowed if there is a known and matching mime type, the idea that in 2022 people rely on extensions for uploads is a huge security problem. A simple composer require is all it takes: https://packagist.org/packages/league/mime-type-detection to start making things right...
avatar obuisard
obuisard - comment - 11 Oct 2022

Thank you Dimitris @dgrammatiko. I did address the first review, fixed formatting and tested the code successfully.

As far as the tests are concerned, a solution would be to remove testUpdateFileWithoutAdapter all together, but I would appreciate someone's expertise on this.

avatar dgrammatiko
dgrammatiko - comment - 11 Oct 2022

a solution would be to remove testUpdateFileWithoutAdapter all together,

@laoneo could you advise here?

avatar laoneo
laoneo - comment - 17 Oct 2022

Removing the test is a bad idea. Better to set the default to 0, so no thumbs will be generated and the admin has to activate it. If it is on by default, then after the update all thumbnails are generated without notice, which can lead to resource issues on large sites.

avatar obuisard
obuisard - comment - 26 Oct 2022

I have modified the code to make the thumbnail creation 0 by default. It does solve issues with tests. Thank you @laoneo for the suggestion.

avatar obuisard obuisard - change - 26 Oct 2022
Labels Added: Documentation Required
avatar jwaisner
jwaisner - comment - 8 Nov 2022

I have tested this item successfully on 53bc63a

Everything looks good after applying the PR.


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

avatar jwaisner jwaisner - test_item - 8 Nov 2022 - Tested successfully
avatar N6REJ
N6REJ - comment - 8 Nov 2022

I have tested this item successfully on 53bc63a


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

avatar N6REJ N6REJ - test_item - 8 Nov 2022 - Tested successfully
avatar N6REJ N6REJ - change - 8 Nov 2022
The description was changed
Status Pending Ready to Commit
avatar joomla-cms-bot joomla-cms-bot - edited - 8 Nov 2022
avatar N6REJ
N6REJ - comment - 8 Nov 2022

RTC

avatar obuisard obuisard - change - 8 Nov 2022
Labels Added: ?
avatar obuisard
obuisard - comment - 8 Nov 2022

First comment on this PR was edited by the bot, removing information.
Thank you to @dgrammatiko for this work, it's a big step into improving the performance of the media manager.
For information, turning on thumbnails can be found in the Filesystem 'Local' plugin.
Joomla 4 documentation found at https://docs.joomla.org/Chunk4x:Extensions_Plugin_Manager_Edit_FileSystem_Group

image

avatar obuisard obuisard - change - 9 Nov 2022
The description was changed
avatar obuisard obuisard - edited - 9 Nov 2022
avatar richard67 richard67 - change - 10 Nov 2022
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 10 Nov 2022

Back to pending because changes were made and more changes were requested.


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

avatar obuisard obuisard - change - 10 Nov 2022
Labels Removed: ?
avatar obuisard obuisard - change - 10 Nov 2022
The description was changed
avatar obuisard obuisard - edited - 10 Nov 2022
avatar obuisard obuisard - change - 11 Nov 2022
The description was changed
avatar obuisard obuisard - edited - 11 Nov 2022
avatar obuisard
obuisard - comment - 19 Jan 2023

Troy @N6REJ and Jacob @jwaisner, would you mind re-testing this so we can merge it? Thank you so much!

avatar jwaisner jwaisner - test_item - 19 Jan 2023 - Tested successfully
avatar jwaisner
jwaisner - comment - 19 Jan 2023

I have tested this item successfully on d82abd9

Everything retested well. No issues.


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

avatar N6REJ N6REJ - test_item - 19 Jan 2023 - Tested unsuccessfully
avatar N6REJ
N6REJ - comment - 19 Jan 2023

I have tested this item ? unsuccessfully on d82abd9

in my test the images were already thumbnailed without the PR. This was " The currently installed Joomla! version is "‎4.3.0-dev"‎4.3.0-dev"
with the latest composer & npm.
plugin setting did not exist w/o the pr as expected.
Media manager image Without PR..
image
image with pr
image

original image
DSC_5613-closeup-


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38805.
avatar obuisard
obuisard - comment - 19 Jan 2023

in my test the images were already thumbnailed without the PR.

That's strange. The thumbnails created with the PR should be 200x200.

avatar dgrammatiko
dgrammatiko - comment - 19 Jan 2023

@obuisard what @N6REJ is showcasing is the SIZE of the container DIV, not the size of the image. To get the size of the image open the browser tools, select the image in the elements tab and in the console type $0.naturalWidth (or naturalHeight for the height). False alarm...

avatar obuisard
obuisard - comment - 19 Jan 2023

@obuisard what @N6REJ is showcasing is the SIZE of the container DIV, not the size of the image. To get the size of the image open the browser tools, select the image in the elements tab and in the console type $0.naturalWidth (or naturalHeight for the height). False alarm...

Oh good catch Dimitris @dgrammatiko! @N6REJ can you double-check? Thank you!

avatar Quy
Quy - comment - 19 Jan 2023

Blurry quality:
38805-blurry-quality

Before PR:
38805-gif-before

After PR:
38805-gif-after

avatar obuisard
obuisard - comment - 19 Jan 2023

Thank you, Troy @N6REJ for reporting those issues.
The image quality and handling of transparency for GIFs is unrelated to this PR, but improvements need to be made to the image library itself. Something for another PR...

avatar N6REJ N6REJ - test_item - 20 Jan 2023 - Tested successfully
avatar N6REJ
N6REJ - comment - 20 Jan 2023

I have tested this item successfully on d82abd9

retested as instructed.
image


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38805.
avatar N6REJ N6REJ - change - 20 Jan 2023
Status Pending Ready to Commit
avatar obuisard obuisard - change - 20 Jan 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-01-20 00:50:42
Closed_By obuisard
Labels Added: ?
avatar obuisard obuisard - close - 20 Jan 2023
avatar obuisard obuisard - merge - 20 Jan 2023
avatar obuisard
obuisard - comment - 20 Jan 2023

A big thank you to Dimitris @dgrammatiko and the testers !

avatar carlitorweb
carlitorweb - comment - 20 Jan 2023

Documentation added ✔️

avatar dgrammatiko
dgrammatiko - comment - 20 Jan 2023

@obuisard I haven't checked but is the thumbnails functionality bypasses the svg files? If not it needs to do so, the thumbs helper expects only files that the Image class can handle. I'll try to check the next days if I get some free time

avatar obuisard
obuisard - comment - 20 Jan 2023

@obuisard I haven't checked but is the thumbnails functionality bypasses the svg files? If not it needs to do so, the thumbs helper expects only files that the Image class can handle. I'll try to check the next days if I get some free time

@dgrammatiko I have checked SVG and image thumbnail creation and both work well together. The image.php file specifies which image file formats can be treated by the GD library .

avatar N6REJ
N6REJ - comment - 20 Jan 2023

it's sad that we are using GD instead of imagemagick.

avatar obuisard
obuisard - comment - 20 Jan 2023

it's sad that we are using GD instead of imagemagick.

I know, but GD is more widely installed than imagick. It would be great to offer the use of either one of those graphic libraries in Joomla.

avatar dgrammatiko
dgrammatiko - comment - 20 Jan 2023

You'll be surprised but GD (PHP 8.1+) is (median) faster than imagick. How do I know? I keep testing these for responsive-images

avatar N6REJ
N6REJ - comment - 21 Jan 2023

@dgrammatiko faster but I thought imagick quality was far higher?

Add a Comment

Login with GitHub to post a comment