Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying for GIF's metadata removes animation #726

Open
hrishikesh-k opened this issue Jun 10, 2024 · 1 comment
Open

Querying for GIF's metadata removes animation #726

hrishikesh-k opened this issue Jun 10, 2024 · 1 comment

Comments

@hrishikesh-k
Copy link

Reproduction repo: https://github.com/hrishikesh-k/t-rish. In it, I have an animated GIF: https://github.com/hrishikesh-k/t-rish/blob/main/src/routes/work/four-forty-four/assets/hamilton-1.gif

I'm using vite-imagetools to only get the metadata (height,src,width) of an image. I am offloading image transformations to Netlify Image CDN, so the metadata is all I need. However, somewhere in this process, the animation of the GIF is lost.

This is where I'm setting the metadata params: https://github.com/hrishikesh-k/t-rish/blob/main/vite.config.ts#L10 and this is where I'm importing the image: https://github.com/hrishikesh-k/t-rish/blob/main/src/routes/work/four-forty-four/%2Blayout.ts#L4. At first I was confused to understand why the animation is not working in the browser, but when I inspected the image in the output directory ./build/_app/immutable/assets/hamilton-1.[hash].gif, I found out that it's the generated image that doesn't animate anymore.

What am I doing wrong?

@bryanmylee
Copy link

Coming from Svelte's enhanced-img which depends on this package, and it seems to break all animated GIF support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants