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

Fix uninformative error message when uploading unsupported image files #13540

Merged

Conversation

ClearlyClaire
Copy link
Contributor

Attempting to upload image files that the browser is unable to load results
in “Oops! An unexpected error occurred.”

This commit changes the error handling so that an unprocessable image results
in the file being sent anyway, which might cover a few corner cases, and
provide a slightly better error message.

I'm not sure it's the best way to go about it, as it is very unlikely that such an error would mean the image won't be usable server-side either, but on the plus side, it would also allow us to accept more image types on the backend (since user-uploaded images are processed by imagemagick anyway), and may cover more corner cases in outdated/broken browsers/configs.

Attempting to upload image files that the browser is unable to load results
in “Oops! An unexpected error occurred.”

This commit changes the error handling so that an unprocessable image results
in the file being sent anyway, which might cover a few corner cases, and
provide a slightly better error message.
@ClearlyClaire ClearlyClaire force-pushed the fixes/resize-image-unsupported-browser branch from aead07a to f79c97d Compare April 24, 2020 13:04
@ClearlyClaire
Copy link
Contributor Author

Note that it was discovered by someone trying to upload an HEIC picture (presumably by drag'n'drop, so it wasn't obvious that it wasn't supported). We could accept such files in the backend, ImageMagick would know how to handle them.

@Gargron Gargron merged commit be63714 into mastodon:master Apr 25, 2020
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.

2 participants