Переглянути джерело

Fix max_animation_frames option

DarthSim 2 роки тому
батько
коміт
26cd81dcf3
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      processing/processing.go

+ 2 - 2
processing/processing.go

@@ -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())