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

Convert gif in webp keeping frames #534

Closed
paul-mesnilgrente opened this issue Sep 15, 2021 · 3 comments
Closed

Convert gif in webp keeping frames #534

paul-mesnilgrente opened this issue Sep 15, 2021 · 3 comments

Comments

@paul-mesnilgrente
Copy link

Hi,

I wrote something very simple like @image.format 'webp'. The image is a gif. But the webp contains only 1 frame. Is there an option to keep the frames?

@paul-mesnilgrente
Copy link
Author

Note that running convert test.gif test.webp in the CLI keeps all the frames.

I have imagemagick 7 installed and convert list -format has those lines:

GIF* GIF       rw+   CompuServe graphics interchange format
WEBP* WEBP      rw+   WebP Image Format (libwebp 1.0.3 [020E])

The "+" indicates that multiple frames is supported.

@richardmatthewsdev
Copy link

Hey,

Is there any update on this issue? At the moment we are having to resort to using https://github.com/minimagick/minimagick#metal to get this working. Would be great if the animated gif to animated webp conversion was supported by the normal conversion.

Thanks,
Richard

@janko
Copy link
Member

janko commented Jun 7, 2024

MiniMagick::Image#format by default selects only the first page, to avoid generating arrays of images it doesn't know how to handle, because it doesn't know whether source or destination format are multi-layer or not.

You can pass nil for the page argument to process all layers:

@image.format 'webp', nil

@janko janko closed this as completed Jun 7, 2024
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

3 participants