瀏覽代碼

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