[4.2] Do not set a width of 0 in media thumbnails#38535
Merged
roland-d merged 6 commits intojoomla:4.2-devfrom Sep 2, 2022
Merged
[4.2] Do not set a width of 0 in media thumbnails#38535roland-d merged 6 commits intojoomla:4.2-devfrom
roland-d merged 6 commits intojoomla:4.2-devfrom
Conversation
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? |
Member
Author
|
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. |
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. |
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
reviewed
Aug 21, 2022
administrator/components/com_media/resources/scripts/components/browser/items/image.vue
Show resolved
Hide resolved
Member
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38535. |
Contributor
|
Thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.