Skip to content
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

Graceful handling of image filetypes not supported by SimpleImage #1049

Closed

Conversation

ehawman-rosenberg
Copy link
Contributor

@ehawman-rosenberg ehawman-rosenberg commented Dec 17, 2021

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
CUPjBteTCt.

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 and template.php to generate the graceful /thumbnail-unavailable.png
lm09Kcbnie
image

Alternatively, we could keep isImage filtering by mimetype and then have an exception from SimpleImage's failure to generate a thumbnail trigger thumbnail-unavailable. This is probably the cleaner way but I don't have time :)

@ehawman-rosenberg
Copy link
Contributor Author

I went to make some other changes and realized I was forking off of an edited Develop branch (oops). I'm going to close this pull and reopen once I've sorted all my conflicts out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsupported image files fail to generate thumbnails (tif)
1 participant