1
0
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:
DarthSim
2024-01-27 18:34:21 +03:00
parent 4684abf0c0
commit 880d16f457
4 changed files with 16 additions and 1 deletions

View File

@ -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 {