Discourse Animated Avatars adds the ability for users to upload gif avatars which will animate on hover or selection in posts, user cards, and profile pages.
By default, this pauses animation when not focused. Within topics, animation will pause when post is not hovered or selected.
animated_avatars_always_animate: overrides the above pausing, forces avatars to always animate. animated_avatars_min_trust_level_to_display restrict animating of avatars by trust level.
Respects prefers-reduced-motion in the browser’s accessibility options: Animations will be disabled entirely.
Configuration
This plugin has an optional dependency on gifsicle. This is used to resize uploaded gif images to fit a square avatar, which helps to wrangle aspect ratios as well as normalize any differences between the static and animated images’ sizes for a smoother swap. The plugin will still function without it, but any non-square avatars may appear stretched when shown.
To enable, you will add a call to the install script in your app.yml. A example of what the after_code hook will look like is the following:
Some users are reporting the avatar being returned as .png despite the media type being gif.
At this time I’m just trying to understand if it’s something that could be related to the plugin/discourse/nginx or user.
I’ve already a use case in which the issue was the user accessing their Windows machine via RDP but in a specific report I’m having a user with Windows 10 Version 22H2 OS Build 19045.2728 and Chrome 111.0.5563.65 (64bit) but this is what is being returned to the browser:
The 108_2.png is an avatar.
If I check the same topic, I can see that I’m receiving the same image but with .gif extension and in fact it loads animated for me.
However, trying to reach the file directly shows me that two versions exists, both a .png version and a .gif version
There are two static assets that get returned – png and gif. In “always animate” mode, the PNG is swapped on load of the post via a script for the gif version.
If the user is viewing with blocked JS, that may prevent the animation.
It seems that user pages are now broken with this installed, a quick look returns the following stack trace:
Uncaught TypeError: r.default.compute is not a function
n animated-bound-avatar.js:10
htmlHelper helpers.js:30
Ember 2
l manager.js:746
tag reference.js:136
track validator.js:668
animated-bound-avatar.js:10
Unfortunately I don’t know when this started happening.
I haven’t done any debugging on my own yet, but it would’ve had to break between these two commits, as I checked the Discourse diff before updating yesterday evening, and it wasn’t broken before that.
I am having problems with the Animated Avatar Plugin as well - since the last upgrade yesterday. If the plugin is activated the messages page (/u/username/messages) does not load anymore.
Failed to load resource: the server responded with a status of 429 (Too Many Requests)
animated-bound-avatar.js:10 Uncaught TypeError: r.default.compute is not a function
at animated-bound-avatar.js:10:1
at helpers.js:30:1
at index.js:4731:1
at Object.getValue (index.js:4734:1)
at manager.js:746:1
at reference.js:136:1
at e.track (validator.js:668:1)
at f (reference.js:135:1)
at Object.evaluate (runtime.js:3269:1)
at Object.evaluate (runtime.js:1052:1)
at It.evaluateSyscall (runtime.js:4263:1)
at It.evaluateInner (runtime.js:4234:1)
at It.evaluateOuter (runtime.js:4227:1)
at Wt.next (runtime.js:5058:1)
at Wt._execute (runtime.js:5045:1)
at Wt.execute (runtime.js:5038:1)
at zt.handleException (runtime.js:4372:1)
at Ut.handleException (runtime.js:4580:1)
at Ft.throw (runtime.js:4319:1)
at $e.evaluate (runtime.js:2091:1)
at Ft._execute (runtime.js:4306:1)
at Ft.execute (runtime.js:4291:1)
at Kt.rerender (runtime.js:4606:1)
at wr.render (index.js:6751:1)
at index.js:7013:1
at Mt (runtime.js:4139:1)
at Tr._renderRoots (index.js:6996:1)
at Tr._renderRootsTransaction (index.js:7039:1)
at Tr._revalidate (index.js:7072:1)
at p.invoke (queue.ts:201:14)
at p.flush (queue.ts:98:13)
at h.flush (deferred-action-queues.ts:75:19)
at $._end (index.ts:616:32)
at $.end (index.ts:298:10)
at $._run (index.ts:667:14)
at $.run (index.ts:339:17)
at d (index.js:109:1)
at u.success (ajax.js:105:1)
at l (jquery.js:3213:1)
at Object.fireWith [as resolveWith] (jquery.js:3343:1)
at E (jquery.js:9617:1)
at XMLHttpRequest.<anonymous> (jquery.js:9878:1)
Uncaught TypeError: Cannot destructure property 'hasBlock' of 'e' as it is undefined.
at b.getConnectors (plugin-outlet.js:87:19)
at B._join (index.ts:646:21)
at B.join (index.ts:362:17)
at p (index.js:156:1)
at index.js:257:1
at o.getValue (install-function-helper-manager.js:42:12)
at manager.js:746:1
at reference.js:131:1
at e.track (validator.js:657:1)
at d (reference.js:130:1)
at runtime.js:1648:1
at reference.js:131:1
at e.track (validator.js:657:1)
at d (reference.js:130:1)
at index.js:5579:1
at reference.js:131:1
at e.track (validator.js:657:1)
at d (reference.js:130:1)
at index.js:5579:1
at reference.js:131:1
at e.track (validator.js:657:1)
at d (reference.js:130:1)
at reference.js:306:1
at reference.js:131:1
at e.track (validator.js:657:1)
at d (reference.js:130:1)
at Object.evaluate (runtime.js:3437:1)
at Object.evaluate (runtime.js:1052:1)
at It.evaluateSyscall (runtime.js:4258:1)
at It.evaluateInner (runtime.js:4229:1)
at It.evaluateOuter (runtime.js:4222:1)
at Wt.next (runtime.js:5053:1)
at Wt._execute (runtime.js:5040:1)
at Wt.execute (runtime.js:5033:1)
at $t.handleException (runtime.js:4367:1)
at qt.handleException (runtime.js:4575:1)
at Dt.throw (runtime.js:4314:1)
at Be.evaluate (runtime.js:2088:1)
at Dt._execute (runtime.js:4301:1)
at Dt.execute (runtime.js:4286:1)
at Ht.rerender (runtime.js:4601:1)
at wr.render (index.js:6742:1)
at index.js:7004:1
at Mt (runtime.js:4134:1)
at Cr._renderRoots (index.js:6987:1)
at Cr._renderRootsTransaction (index.js:7030:1)
at Cr._revalidate (index.js:7063:1)
at p.invoke (queue.ts:201:14)
at p.flush (queue.ts:98:13)
at h.flush (deferred-action-queues.ts:75:19)
at B._end (index.ts:616:32)
at B.end (index.ts:298:10)
at B._run (index.ts:667:14)
at B.run (index.ts:339:17)
at d (index.js:108:1)
at t.success (ajax.js:115:7)
at l (jquery.js:3213:1)
at Object.fireWith [as resolveWith] (jquery.js:3343:1)
at x (jquery.js:9617:1)
at XMLHttpRequest.<anonymous> (jquery.js:9878:1)