-
My ProblemAn animated gif file input with My SituationMy local markdown files(Obsidian) contain jpeg and gif(animated). I use 11ty and markdown-it-eleventy-img to render them. I'd like to have webp(static) and jpeg outputs from jpeg inputs. Possible WorkaroundI could go with webp outputs only since it can work both static and animated format. My ThoughtThis vertically long jpeg thing is referred as "toilet roll" on the Sharp website.
So this is expected but at least for my use, it's not desirable. If I could choose the animated option on each output, that would solve my problem. As far as I understand, it's not how it works. The sharp option comes first and then output options(webp,png,jpeg and avif) follow. eleventy-img and markdown-it-eleventy-img just pass the options to the Sharp constructor so it's more about the constructor. I'm assuming me using markdown is making things harder. Buf if there are some settings or other workarounds to avoid the jpeg toilet roll, I'd like to know. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I figured out a solution working for me.
This is NOT checking whether a gif file is static or animated but this works for me because I only use animated gifs. That's the case for most of people too I assume. You can change If you don't use markdown-it-eleventy-img then I'm assuming you can just do the same thing to eleventy-img. I don't know even that's necessary though. Hope this is helpful. |
Beta Was this translation helpful? Give feedback.
I figured out a solution working for me.
Since I'm using markdown-it-eleventy-img and it overrides eleventy-img's options, I modified index.js in the markdown-it-eleventy-img folder.
This is NOT checking whether a gif file is static or animated but this works for me because I only use animated gifs. That's the case for most of people too I assume. You can change
sharpOptions: {animated: true/false}
inst…