1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-06-17 22:37:33 +02:00

Fix animated JPEG XL support

This commit is contained in:
DarthSim
2024-12-08 21:07:36 +03:00
parent 9d955444df
commit d9abf2d3d7
5 changed files with 13 additions and 9 deletions

View File

@ -54,7 +54,7 @@ func isImageTypePreferred(imgtype imagetype.Type) bool {
func findBestFormat(srcType imagetype.Type, animated, expectAlpha bool) imagetype.Type {
for _, t := range config.PreferredFormats {
if animated && !t.SupportsAnimation() {
if animated && !t.SupportsAnimationSave() {
continue
}
@ -248,8 +248,8 @@ func ProcessImage(ctx context.Context, imgdata *imagedata.ImageData, po *options
animationSupport :=
po.SecurityOptions.MaxAnimationFrames > 1 &&
imgdata.Type.SupportsAnimation() &&
(po.Format == imagetype.Unknown || po.Format.SupportsAnimation())
imgdata.Type.SupportsAnimationLoad() &&
(po.Format == imagetype.Unknown || po.Format.SupportsAnimationSave())
pages := 1
if animationSupport {
@ -304,7 +304,7 @@ func ProcessImage(ctx context.Context, imgdata *imagedata.ImageData, po *options
return nil, fmt.Errorf("Can't save %s, probably not supported by your libvips", po.Format)
}
if po.Format.SupportsAnimation() && animated {
if po.Format.SupportsAnimationSave() && animated {
if err := transformAnimated(ctx, img, po, imgdata); err != nil {
return nil, err
}