-
-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate image files vs simpleimage (and svg) #1051
base: develop
Are you sure you want to change the base?
Validate image files vs simpleimage (and svg) #1051
Conversation
…iles-vs-simpleimage
Apologies for all the fiddle-faddling. Again, I'm learning Git an GitKraken decided to whip me around. I was under the impression that if I branched from my fork of Develop, that the subsequent branches would inherit changes. |
No need to apologize! Thanks for your improvements! |
EDIT: Sorry, not meant to ask why you added it as you've already explained that, but why is it in this version as it does not seem to be used yet. Thanks for this! One question, why did you add dmhendricks/file-icon-vectors? |
I should have started a new branch once I started going down the icons road. This current version handles SVGs, and serves up a "picture unavailable" placeholder when the file is an image that isn't in the hardcoded SimpleImage types list. I've created another branch for catching SimpleImage exceptions and serving up the appropriate icon from the pack. |
Closes #1048
Currently, if a file returns TRUE for isImage() (which checks vs mimetype), but isn't supported by SimpleImage, we get a broken link
.
SimpleImage supports "gif", "jpg", "jpeg", "png", "webp", and "bmp" formats (also "jfif" which is just another jpg variant). We also have a way to handle svg file previews.
As such, I am validating whether an image is embeddable vs these extensions, and I've changed the structure of the preview generation in
manage-files.php
andtemplate.php
to generate the graceful/thumbnail-unavailable.png
Ultimately I'd like to keep isImage() filtering by mimetype and then have an exception from SimpleImage's failure to generate a thumbnail fail us over into a matching icon from danhendricks' file-icon-vectors.
However, I'm having trouble figuring out how to get Composer to download the package. What calls it and when? Putting it in
composer.json
hasn't worked.What am I missing?