瀏覽代碼

Cast to uchar when saving to BMP

DarthSim 4 年之前
父節點
當前提交
3882abae48
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      process.go

+ 1 - 1
process.go

@@ -770,7 +770,7 @@ func processImage(ctx context.Context) ([]byte, context.CancelFunc, error) {
 
 	checkTimeout(ctx)
 
-	if po.Format == imageTypeGIF {
+	if po.Format == imageTypeGIF || po.Format == imageTypeBMP {
 		if err := img.CastUchar(); err != nil {
 			return nil, func() {}, err
 		}