-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
AVIF media attachment is broken. #25007
Comments
I test ImageMagick's command that is shown in paperclip logs.
Dockerfile
avifConvert.sh
kimono.mirror-vertical.avif result:
|
sample image is downloaded from https://github.com/link-u/avif-sample-images |
paperclip also runs
|
On mastodon.social, v4.1.2+nightly-20230508, when I try to download an uploaded file, it returns a response with mime-type as image/heic, even though the extension is avif, and actually A binary file in HEIC format is downloaded. This causes the browser to recognize it as a broken image. If you download the file by specifying the URL directly, you will get the file. |
On the other hand, if you upload an avif attachment on another server that works as expected (e.g. fedibird.com) and it is received by mastodon.social via ActivityPub, it will also be treated as an avif by mastodon.social. (Expected behavior) |
why? both of actual data and mime type is image/heic. browser should not see extension part in url. |
ImageMagick/ImageMagick#5159 |
This also happens to apngs. Please also add this to the argument for changing the background processing of images in general because it needs an overhaul. |
As far as I can tell, HEIC and AVIF both use the same container format (HEIF) with different codecs (HEVC vs AV1), and ImageMagick handles them through the same code module (called I unfortunately don't think we can make a code change (except ditching ImageMagick for something else) to address the issue. Instead, we need to use an ImageMagick version that handles AVIF correctly.
Because most browsers do not support HEIC. |
I wonder if there is some way the Mastodon software could detect the installed ImageMagick has this problem, at installation or upgrade time say, and alert the admin in some way. Anyhow, the problem is reproducing on mastodon.social as of today. |
Post today's Imagemagick security fix (v4.1.3+nightly-20230706), I tested again with janelle.avif. It still does not work, but the symptom is different. Uploading janelle.avif I get this popup: "422Validation failed: File has contents that are not what they are reported to be". (Formatting error in original) Although this is actually a little more user friendly than the black box, it is still wrong and still not an appropriate failure mode (for example "AVIF not supported." would be a better error). |
Fixed by #26264. |
Steps to reproduce the problem
on mastodon.social, v4.1.2+nightly-20230508
on Chrome Windows, 113.0.5672.93(Official Build) (64 bit)
open Web UI
Drag & Drop AVIF file. sample:
kimono.mirror-vertical.zip
NG: thumbnail on post compose area is filled black.
post.
NG: thumbnail on post on home TL is bluehashed.
click thumbnail.
NG: browser shows "broken image" icon.
Expected behaviour
thumbnail on post compose area is shown, humbnail on post on home TL is shown, browser can show large image.
Actual behaviour
NG: thumbnail on post compose area is filled black. NG: thumbnail on post on home TL is bluehashed. NG: browser shows "broken image" icon.
Detailed description
AVIF issue is also exists #20834 ,
but in this issue no errors thrown, silently image broken.
this is log from mastodon.juggler.jp (4.1.2)
no errors detected, but image was broken.
Specifications
mastodon.social, v4.1.2+nightly-20230508
Chrome Windows, 113.0.5672.93(Official Build) (64 bit)
The text was updated successfully, but these errors were encountered: