StillImage: Improved animated image detection #335

Merged
floatingghost merged 1 commit from yukijoou/akkoma-fe:still-image-better-gif-detection into develop 2023-08-04 15:09:33 +00:00
Contributor

This patch makes StillImage's animation detection return early in cases where we can't detect the mimetype of the image. It also sets the image as animated in those cases if the user agent wants reduced motion.

As reduced motion is an accessibility setting, I think it's best to use a "better safe than sorry" approach, it's better to accidentally mark something as animated that isn't than to have unblocked animations.

Note that this means that if reduced motion is enabled, and we can't figure out the mimetype of an image, it'll be watermarked with "GIF", even though that's not true. I can't see an easy solution to this, and don't think it's enough of a problem to warrant spending a bunch of time probably rethinking this whole system, so I think it's fine to just leave it as is!

This patch makes StillImage's animation detection return early in cases where we can't detect the mimetype of the image. It also sets the image as animated in those cases if the user agent wants reduced motion. As reduced motion is an accessibility setting, I think it's best to use a "better safe than sorry" approach, it's better to accidentally mark something as animated that isn't than to have unblocked animations. Note that this means that if reduced motion is enabled, and we can't figure out the mimetype of an image, it'll be watermarked with "GIF", even though that's not true. I can't see an easy solution to this, and don't think it's enough of a problem to warrant spending a bunch of time probably rethinking this whole system, so I think it's fine to just leave it as is!
yukijoou added 1 commit 2023-08-03 14:40:25 +00:00
StillImage: Improved animated image detection
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
43d0a24547
This patch makes StillImage's animation detection return early in cases
where we can't detect the mimetype of the image. It also sets the image
as animated in those cases if the user agent wants reduced motion.

As reduced motion is an accessibility setting, I think it's best to use
a "better safe than sorry" approach, it's better to accidentally mark
something as animated that isn't than to have unblocked animations.

yeah this is an edge-case, but one where i'm happy to accept the compromise of assuming things we can't detect are animated

seems fine to me

thankies!

yeah this is an edge-case, but one where i'm happy to accept the compromise of assuming things we can't detect are animated seems fine to me thankies!
floatingghost merged commit 5a9322d2c7 into develop 2023-08-04 15:09:33 +00:00
floatingghost deleted branch still-image-better-gif-detection 2023-08-04 15:09:33 +00:00
mel referenced this pull request from a commit 2024-05-15 22:36:01 +00:00
Sign in to join this conversation.
No description provided.