Skip to content

[4.2] Do not set a width of 0 in media thumbnails#38535

Merged
roland-d merged 6 commits intojoomla:4.2-devfrom
Digital-Peak:media/thum/width
Sep 2, 2022
Merged

[4.2] Do not set a width of 0 in media thumbnails#38535
roland-d merged 6 commits intojoomla:4.2-devfrom
Digital-Peak:media/thum/width

Conversation

@laoneo
Copy link
Copy Markdown
Member

@laoneo laoneo commented Aug 19, 2022

Summary of Changes

Since #36930 the thumbnail image of a media item is an image HTML element. When the width and height are 0, then the image is rendered with 0 width/height and invisible. Instead of the attributes should be ignored. This pr adds no attribute when width and height are not available and sets loading not to lazy.

Testing Instructions

  • Remove the lines 342 and 343 in plugins/filesystem/local/src/Adapter/LocalAdapter.php
  • Open the media manager in the back end

Actual result BEFORE applying this Pull Request

No preview image is visible, because it has width and height of 0.

Expected result AFTER applying this Pull Request

A preview image is shown with no width/height/loading attribute.

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.2-dev labels Aug 19, 2022
@brianteeman
Copy link
Copy Markdown
Contributor

After rebuilding the media manager I can confirm this works

BUT - in what scenario would the image ever have a height/width of 0?

@laoneo
Copy link
Copy Markdown
Member Author

laoneo commented Aug 21, 2022

When you fetch data from an external service like FTP, then there is no image information. Since 4.1 a width/height attribute is required as int value, the adapter has to return at least 0. You can try it with the free version of DPMedia and the FTP adapter.

@brianteeman
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 4c87bcb

Thanks for explaining the use case


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

@viocassel
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 4c87bcb


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

@richard67
Copy link
Copy Markdown
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 21, 2022
@roland-d roland-d merged commit 1c4fcf6 into joomla:4.2-dev Sep 2, 2022
@roland-d roland-d deleted the media/thum/width branch September 2, 2022 19:14
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 2, 2022
@roland-d
Copy link
Copy Markdown
Contributor

roland-d commented Sep 2, 2022

Thank you

@roland-d roland-d added this to the Joomla! 4.2.2 milestone Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NPM Resource Changed This Pull Request can't be tested by Patchtester

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants