-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
PNG uploads as a file attachment rather than image on develop #24761
Comments
@kittykat please send logs, this happens when your browser's canvas can't generate a thumbnail typically |
|
@kittykat would you be able to share the problem file (internally on the rageshake) |
@t3chguy done! It's a screenshot from a Pixel 6a running Graphene OS. It uploads fine as a photo when I attach it from Element Android |
The file is called
|
🤔 Wonder what my phone is doing… Should JPEGs not be previewed? Is it assuming file type based on extension? If it is, can we get it to check file type instead? |
JPEG should be, but for PNGs we need to check if it is hidpi by parsing it, so if we get given a faulty PNG we have to assume the file is broken not just mis-named
It is asking the browser but some browsers do indeed naively assume by file extension (sometimes being completely wrong for container formats like mkv which can be audio-only or video) It is using this https://developer.mozilla.org/en-US/docs/Web/API/File/type
We would need to bundle large libraries to parse image/video files to handle detection ourselves |
@kittykat matrix-org/matrix-react-sdk#10308 should allow the PNG parsing to fail, but this file is likely to be problematic either way as we'll be sending it with a mime type of |
Steps to reproduce
Outcome
What did you expect?
See image preview
What happened instead?
See file:
Operating system
No response
Browser information
Chromium 110.0.5481.177 (Official Build) Arch Linux (64-bit)
URL for webapp
develop.element.io
Application version
Element version: 5ae88eb-react-32aa18ff2e0e-js-b4cdc5a92397 Olm version: 3.2.12
Homeserver
matrix.org
Will you send logs?
No
The text was updated successfully, but these errors were encountered: