Comments (7)
Happens with empty bmp,gif,jpg,jpeg,png files but not with ico,pdf,svg
It's expected (code wise). The mime of the image files are checked through PHP functions which will obviously fail for an empty image:
joomla-cms/libraries/src/Helper/MediaHelper.php
Lines 86 to 125 in 45adb61
FWIW I had proposed a safer, faster alternative some time ago...
from joomla-cms.
Such broken image files should be appropriately caught and displayed with a corresponding icon:
Please try to set the error level to None in the global settings and load the Media Manager again.
from joomla-cms.
With error reporting set to none the folder contents is displayed as expected. I can see the above image.
With error reporting set to standard the initial issue shows up.
Additional info: browser console shows:
VM201:1 Uncaught SyntaxError: Unexpected token '<', "
"... is not valid JSON
at JSON.parse ()
at onSuccess (media-manager.min.js?3c55e4:1:84574)
at i.onreadystatechange (core.min.js?83f2c9:1:6174)
onSuccess @ media-manager.min.js?3c55e4:1
i.onreadystatechange @ core.min.js?83f2c9:1
XMLHttpRequest.send (async)
s @ core.min.js?83f2c9:1
r.request @ core.min.js?83f2c9:1
(anonymous) @ media-manager.min.js?3c55e4:1
getContents @ media-manager.min.js?3c55e4:1
getContents @ media-manager.min.js?3c55e4:5
(anonymous) @ media-manager.min.js?3c55e4:5
Store.dispatch @ media-manager.min.js?3c55e4:5
Store.dispatch @ media-manager.min.js?3c55e4:5
navigateTo @ media-manager.min.js?3c55e4:1
onItemClick @ media-manager.min.js?3c55e4:1
(anonymous) @ media-manager.min.js?3c55e4:1
(anonymous) @ media-manager.min.js?3c55e4:1
callWithErrorHandling @ media-manager.min.js?3c55e4:1
callWithAsyncErrorHandling @ media-manager.min.js?3c55e4:1
n @ media-manager.min.js?3c55e4:1
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43279.
from joomla-cms.
With error reporting set to simple the folder contents is displayed as expected also.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43279.
from joomla-cms.
Yes, this is expected behaviour in this case. If PHP writes errors, notices or warnings into the output, the JSON response is no longer valid, and the Media Manager cannot process the response correctly. So, this is the symptom of the issue but not the source.
We should ensure that built-in PHP calls to retrieve image information do not create such errors because a 0-byte image is processed like a valid one.
I solved it years ago in my extensions by checking for the file size first before running any further calls on the file. We could also apply the same logic to the local adapter for the Media Manager.
from joomla-cms.
We could also apply the same logic to the local adapter for the Media Manager.
I think that should be done, and as itβs a bug fix it should be done for the 4.4-dev branch if the issue happens also with 4.4.x. It will later be merged up into 5.1-dev by release managers.
from joomla-cms.
We had a possibly related issue on a customer's site where they had uploaded an animated gif. This triggered the error:
imagecolorsforindex(): Argument #2 ($color) is out of range
in the Media Manager, and no images loaded.
Turns out Create Thumbnails was enabled in the "FileSystem - Local" plugin. Disabling Create Thumbnails fixed the error.
Animated gifs trigger the error on both 4.4 and 5.1 when Create Thumbnails is enabled.
from joomla-cms.
Related Issues (20)
- [5.2] [UX] Consistency: Review Options (parameters)
- [5.2] Usability: Back-end - Add total number of items to Page Navigation HOT 1
- [5.2] Usability: Media Manager - Allow SVG images HOT 1
- [5.2] Usability: add Versioning to Menu Item edit
- [5.2] Usability: Media Manager > edit image > contain instead of cover (think of vertical images) HOT 1
- [5.2] New code feature: Add new Plugin Event in Models in methods PopulateState / getItems
- [5.2] Usability: Media Manager - tick checkbox of newly uploaded Media HOT 1
- [5.2] Usability: Media Manager - Move image to other folder HOT 2
- [5.1] Problem: Menu items with "compact list of tagged items" don't work HOT 3
- [5.2] Usability: Media Manager > Save and new
- [5.1] Problem: Menu items with Item Selection Options doesn't work HOT 3
- 4.4.5 : update gives checksum error HOT 1
- [5.1] Non-Cassiopeia front-end editor is told 'you have been logged out' after clicking media button
- multiselect.js issue with unwanted selections HOT 5
- table.columns breaks if tfoot or colgroup are used in the table HOT 4
- Unable to install languages HOT 3
- Joomla accessibility checker in frontend HOT 5
- Related Article Module sort articles HOT 3
- com_finder not found HOT 1
- Plugin for vote article! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joomla-cms.