[bug] still-image doesn't detect extensionful APNG with mediaproxy off #381

Open
opened 2024-03-26 22:52:29 +00:00 by novenary · 1 comment

Version

ed0b403

What were you trying to do?

Uploaded an APNG image.
https://akko.wtf/notice/Ag95iENE4XtQrDMXKa

What did you expect to happen?

With still-image enabled, the image should not animate.

What actually happened?

The image animates.

This is because still-image only falls back to detectAnimationWithFetch with extensionless URLs. Additionally, it will still greedily mark local .gif and .webp images as animated, even though CORS would allow fetching them just fine.

ed0b403c33/src/components/still-image/still-image.js (L114-L118)

I know it's basically impossible to reliably detect animated images without mediaproxy, but it should at least work correctly for local media. :P

Severity

I can manage

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Version ed0b403 ### What were you trying to do? Uploaded an APNG image. https://akko.wtf/notice/Ag95iENE4XtQrDMXKa ### What did you expect to happen? With still-image enabled, the image should not animate. ### What actually happened? The image animates. This is because still-image only falls back to detectAnimationWithFetch with extensionless URLs. Additionally, it will still greedily mark local .gif and .webp images as animated, even though CORS would allow fetching them just fine. https://akkoma.dev/AkkomaGang/akkoma-fe/src/commit/ed0b403c330914ed10c391d4c7ac9f5f9e606da8/src/components/still-image/still-image.js#L114-L118 I know it's basically impossible to reliably detect animated images without mediaproxy, but it should at least work correctly for local media. :P ### Severity I can manage ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
Member

Tangential note: while .png is often used as well (like in the example post), the canonical extension for APNG images is .apng. Regardless of local or not, we could always match at least the latter.

Tangential note: while `.png` is often used as well *(like in the example post)*, the [canonical extension](https://www.iana.org/assignments/media-types/image/apng) for APNG images is `.apng`. Regardless of local or not, we could always match at least the latter.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: AkkomaGang/akkoma-fe#381
No description provided.