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

Is there a way to preserve the animation when exporting GIF to webp? #445

Open
Rusinas opened this issue Aug 16, 2024 · 1 comment
Open

Comments

@Rusinas
Copy link

Rusinas commented Aug 16, 2024

Subject.

I optimize all the user uploaded images by exporting it to webp with lower quality, but sometimes they upload GIF's and animations are gone after the export, but webp supports animations, as well as libvips support export to webp with animations.

Unfortuanetely, I don't see anything related to this on ep := vips.NewWebpExportParams()

@n0vad3v
Copy link
Contributor

n0vad3v commented Aug 16, 2024

You need to pass in NumPages like importParams.NumPages.Set(-1) on load, for example:

	importParams := vips.NewImportParams()
	importParams.NumPages.Set(-1)
	img, err := vips.LoadImageFromBuffer(buf, importParams)
	if err != nil {
		return nil, err
	}

Refer to #246

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