[bug] Animated images play even when animate-on-hover is enabled when Media Proxy is disabled #344

Closed
opened 2023-09-30 21:30:20 +00:00 by norm · 2 comments
Contributor

Version

8afbe5e3bc

What were you trying to do?

I'd like to be able to only have images animate when the cursor is hovering over them. This was working in earlier versions of Akkoma-FE until #341 was merged.

What did you expect to happen?

Animated images aren't animated until the cursor is hovering over them.

What actually happened?

Animated images are animated without the cursor being over.

This appears to be due to the detectAnimation method returning early if mediaproxy is disabled on the instance:

// harmless CORS errors without-- clean console with
if (!mediaProxyAvailable) {
// It's a bit aggressive to assume all images we can't find the mimetype of is animated, but necessary for
// people in need of reduced motion accessibility. As such, we'll consider those images animated if the user
// agent is set to prefer reduced motion. Otherwise, it'll just be used as an early exit.
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
// Only for no media-proxy for now, since we're capturing gif, webp, and apng (are there others?)
// Since the canvas and images are not pixel-perfect matching (due to scaling),
// It makes the images jiggle on hover, which is not ideal for accessibility, methinks
this.isAnimated = true
}
return
}

I'm currently not running media proxy on my instance.

Severity

I cannot use it as easily as I'd like

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Version 8afbe5e3bcf6f4391da4a542246034e529b12ce8 ### What were you trying to do? I'd like to be able to only have images animate when the cursor is hovering over them. This was working in earlier versions of Akkoma-FE until https://akkoma.dev/AkkomaGang/akkoma-fe/issues/341 was merged. ### What did you expect to happen? Animated images aren't animated until the cursor is hovering over them. ### What actually happened? Animated images are animated without the cursor being over. This appears to be due to the `detectAnimation` method returning early if mediaproxy is disabled on the instance: https://akkoma.dev/AkkomaGang/akkoma-fe/src/commit/8afbe5e3bcf6f4391da4a542246034e529b12ce8/src/components/still-image/still-image.js#L45-L57 I'm currently not running media proxy on my instance. ### Severity I cannot use it as easily as I'd like ### Have you searched for this issue? - [ ] I have double-checked and have not found this issue mentioned anywhere.
Member

Definitely doable, the only caveat methinks would be that we wouldn't be able to detect whether a png or a webp is animated or not, and they'd show the label on the top right. We'd aggressively just mark as animated any webp/gif (png would be overkill methinks) we encounter. That'd be fine by ye? (It's basically what it was doing before lol)

Definitely doable, the only caveat methinks would be that we wouldn't be able to detect whether a png or a webp is animated or not, and they'd show the label on the top right. We'd aggressively just mark as animated any webp/gif (png would be overkill methinks) we encounter. That'd be fine by ye? (It's basically what it was doing before lol)
Author
Contributor

Yeah I think that would be fine.

Yeah I think that would be fine.
Mergan added the
Bug
label 2023-10-02 22:37:13 +00:00
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#344
No description provided.