code icon indicating copy to clipboard operation
code copied to clipboard

Gifs in the project description are not working properly

Open TheBlackSwitch opened this issue 7 months ago • 7 comments

Please confirm the following.

What browsers are you seeing the problem on?

Chrome (including Arc, Brave, Opera, Vivaldi)

Describe the bug

An image showing a gif that doen't play it's animation but does load  and another one that just doen't load at all

Steps to reproduce

  1. create a new project
  2. place the gif in the description: ![A gif showing the chest opening process](https://wsrv.nl/?url=https://theblackswitch.com/assets/images/ancient_artifacts/AA-artifact_chest_open.gif&n=-1) or ![A gif showing the upgrading process](https://wsrv.nl/?url=https://theblackswitch.com/assets/images/ancient_artifacts/AA-upgrading.gif&n=-1)
  3. observe that the gifs aren't loading correctly while it works when you try to load them in the web browser

Expected behavior

The gifs should just load and play their animation

Additional context

Something to note maby is that the gifs are around 10Mb in size which is quite big, the issue isn't applying to my small gifs of a couple kbs. Altho I couldn't find any details about size limits anywhere.

TheBlackSwitch avatar Jun 14 '25 08:06 TheBlackSwitch

Have you considered using silent .mp4 or .webm videos for these clips instead? GIF is a noticeably outdated and inefficient format these days. Even if GIFs worked as expected, you'd very likely benefit from switching to alternatives that produce smaller files, helping your project page load faster.

AlexTMjugador avatar Jun 14 '25 09:06 AlexTMjugador

They are quite short (10s) and I would like them to play without the user having to click on the video to play

TheBlackSwitch avatar Jun 14 '25 09:06 TheBlackSwitch

Also my website doesn't have that much bandwidth so I was using wrsv inorder to help with that. I don't think this works for videos right?

TheBlackSwitch avatar Jun 14 '25 09:06 TheBlackSwitch

wsrv.nl claims to support animated WebP, which should be like GIF but better. What about using that?

AlexTMjugador avatar Jun 14 '25 09:06 AlexTMjugador

Oh really? Hmm thanks! I will look into that :)

TheBlackSwitch avatar Jun 14 '25 09:06 TheBlackSwitch

hmm the image does load in modrinth but it doesn't play the animation https://wsrv.nl/?url=https://theblackswitch.com/assets/images/ancient_artifacts/AA-recycling.webp&n=-1

TheBlackSwitch avatar Jun 14 '25 10:06 TheBlackSwitch

I've reproduced the issue with the https://wsrv.nl/?url=https://theblackswitch.com/assets/images/ancient_artifacts/AA-recycling.webp&n=-1 image URL and can confirm that it's an issue with how our Markdown parser escapes additional query parameters in URLs, at least in the preview page.

The URL gets translated to https://wsrv.nl/?url=https://theblackswitch.com/assets/images/ancient_artifacts/AA-recycling.webp&;n=-1 (notice the extra ; after the last &), which makes wsrv serve the image as static. You could work around this by using a URL without query parameters, though simple 301 redirects seem to not work here.

AlexTMjugador avatar Jun 14 '25 11:06 AlexTMjugador