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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user