Closed germyparker closed 1 year ago
Thanks for your report 👍 would you like to drop a PR for that?
I'd like to give it a shot! But no promises - I'm not entirely sure I'll be able to figure out why it's happening.
@germyparker did you find something?
Sorry, it's been a crazy few months - I did have a chance to look, and I was able to understand approximately how it works - up until - but not including - how the actual image derivative is created. imageTransformer$
accepts the source, the breakpoints, and the height (calculated via breakpoints / ratio / original w,h), and sends it to..the QRL.
I read up on QRLs in general - but I won't pretend like I understood, and while I think this is the magic that makes it happen, I wasn't able to understand how and where the .webp file is created.
I've done a decent amount of image derivative creation, including dealing with gif/animated webp fails, but I've always done it via bash+imagemagick, so I'm hoping that experience will come in handy, but I feel like I'm fundamentally misunderstanding something important about the flow - it all makes sense until - poof - the image derivative is created! And I have no idea how.
So yeah - can you point me in the direction of the conversion? Or, if I'm misunderstanding something, can you point me in the direction of where you think the problem might be?
Again - sorry for the delay - I should've asked this when I was looking into it, but life's been tossing me around like a frisbee!
I think the main problem here is that we are using srcset with gif images. 🤔 The transformer is only changing the image URL nothing more than that. The transformation is done by the external service. You can check if is gif or not and just return your local website URL
I traced it a bit further just now, and found vite-imagetools doing the conversion - and that's where the problem is. There a couple of issues/PRs in vite-imagetools about this issue - it looks like it will be possible to make this happen in qwik-image, but not until it's implemented at imagetools.
The solution will (probably?) take the form of a bool "animated" flag that gets passed in - not sure if qwik-image will be able to read that automagically or if the user will have to declare it - but I guess we'll have to see how it's handled on that end. Despite not being able to fix it, I appreciate you giving me the nudge to pursue it!
Thanks for your commitment 😊
Not much more to say than the title. Animated webp files also don't stay animated.
to reproduce:
ok I had a minute and I made a repo: https://git.sr.ht/~jeremyparker/qwik-animation-handling