Browse Source

Don't copy memory after smart crop

DarthSim 2 years ago
parent
commit
20960b2013
1 changed files with 1 additions and 6 deletions
  1. 1 6
      processing/crop.go

+ 1 - 6
processing/crop.go

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