mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-06-17 22:37:33 +02:00
Reduce memory usage when scaling down animated images
This commit is contained in:
@ -162,6 +162,16 @@ func transformAnimated(ctx context.Context, img *vips.Image, po *options.Process
|
||||
if err = mainPipeline.Run(ctx, frame, po, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if r, _ := frame.GetIntDefault("imgproxy-scaled-down", 0); r == 1 {
|
||||
if err = frame.CopyMemory(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = router.CheckTimeout(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err = img.Arrayjoin(frames); err != nil {
|
||||
|
Reference in New Issue
Block a user