1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-02-12 11:46:10 +02:00

Don't copy memory after smart crop

This commit is contained in:
DarthSim 2023-02-28 22:03:15 +03:00
parent 70d657113e
commit 20960b2013

View File

@ -25,12 +25,7 @@ func cropImage(img *vips.Image, cropWidth, cropHeight int, gravity *options.Grav
if err := img.CopyMemory(); err != nil {
return err
}
if err := img.SmartCrop(cropWidth, cropHeight); err != nil {
return err
}
// Applying additional modifications after smart crop causes SIGSEGV on Alpine
// so we have to copy memory after it
return img.CopyMemory()
return img.SmartCrop(cropWidth, cropHeight)
}
left, top := calcPosition(imgWidth, imgHeight, cropWidth, cropHeight, gravity, false)