浏览代码

Fix smart crop + brur/sharpen SIGSEGV on Alpine

DarthSim 7 年之前
父节点
当前提交
e163400864
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      process.go

+ 5 - 0
process.go

@@ -324,6 +324,11 @@ func processImage(ctx context.Context) ([]byte, error) {
 			if err = vipsSmartCrop(&img, po.Width, po.Height); err != nil {
 				return nil, err
 			}
+			// Applying additional modifications after smart crop causes SIGSEGV on Alpine
+			// so we have to copy memory after it
+			if err = vipsImageCopyMemory(&img); err != nil {
+				return nil, err
+			}
 		} else {
 			left, top := calcCrop(imgWidth, imgHeight, po)
 			if err = vipsCrop(&img, left, top, po.Width, po.Height); err != nil {