mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-24 08:12:38 +02:00
Fix max_animation_frames option
This commit is contained in:
parent
0d23389385
commit
26cd81dcf3
@ -117,7 +117,7 @@ func transformAnimated(ctx context.Context, img *vips.Image, po *options.Process
|
||||
return err
|
||||
}
|
||||
|
||||
framesCount := imath.Min(img.Height()/frameHeight, config.MaxAnimationFrames)
|
||||
framesCount := imath.Min(img.Height()/frameHeight, po.SecurityOptions.MaxAnimationFrames)
|
||||
|
||||
// Double check dimensions because animated image has many frames
|
||||
if err = security.CheckDimensions(imgWidth, frameHeight, framesCount, po.SecurityOptions); err != nil {
|
||||
@ -235,7 +235,7 @@ func ProcessImage(ctx context.Context, imgdata *imagedata.ImageData, po *options
|
||||
defer vips.Cleanup()
|
||||
|
||||
animationSupport :=
|
||||
config.MaxAnimationFrames > 1 &&
|
||||
po.SecurityOptions.MaxAnimationFrames > 1 &&
|
||||
imgdata.Type.SupportsAnimation() &&
|
||||
(po.Format == imagetype.Unknown || po.Format.SupportsAnimation())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user