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:
parent
70d657113e
commit
20960b2013
@ -25,12 +25,7 @@ func cropImage(img *vips.Image, cropWidth, cropHeight int, gravity *options.Grav
|
|||||||
if err := img.CopyMemory(); err != nil {
|
if err := img.CopyMemory(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := img.SmartCrop(cropWidth, cropHeight); err != nil {
|
return img.SmartCrop(cropWidth, cropHeight)
|
||||||
return err
|
|
||||||
}
|
|
||||||
// Applying additional modifications after smart crop causes SIGSEGV on Alpine
|
|
||||||
// so we have to copy memory after it
|
|
||||||
return img.CopyMemory()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
left, top := calcPosition(imgWidth, imgHeight, cropWidth, cropHeight, gravity, false)
|
left, top := calcPosition(imgWidth, imgHeight, cropWidth, cropHeight, gravity, false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user