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

@@ -606,6 +606,10 @@ func (img *Image) Resize(wscale, hscale float64) error {
return Error()
}
if wscale < 1.0 || hscale < 1.0 {
C.vips_image_set_int(tmp, cachedCString("imgproxy-scaled-down"), 1)
}
C.swap_and_clear(&img.VipsImage, tmp)
return nil