makiuchi-d / gozxing

Port of ZXing (https://github.com/zxing/zxing) core to pure Go.
Other
549 stars 66 forks source link

NotFoundException: startSize = 0 #24

Closed childeYin closed 5 years ago

childeYin commented 5 years ago

"errVerbose":"NotFoundException: startSize = 0: qukan-ugc/vendor/github.com/makiuchi-d/gozxing/qrcode/detector.(*FinderPatternFinder).SelectBestPatterns /data/jenkins/home/workspace/techcenter_content_server-ugc-api/src/qukan-ugc/vendor/github.com/makiuchi-d/gozxing/qrcode/detector/finder_pattern_finder.go:459

makiuchi-d commented 5 years ago

It means that no finder pattern was detected on your image.

childeYin commented 5 years ago

It means that no finder pattern was detected on your image.

thank you

childeYin commented 5 years ago
     image, imageName, err := image.Decode(bytes.NewReader(fileBytes))
if err != nil {
    logger.Logger.Error("qrcode decode failed ", zap.Any("fileBytes len", len(fileBytes)), zap.Any("imageName", imageName), zap.Any("err", err))
    return ""
}
bmp, _ := gozxing.NewBinaryBitmapFromImage(image)

qrReader := qrcode.NewQRCodeReader()
result, err := qrReader.Decode(bmp, nil)

fileBytes len":60503,"imageName":"jpeg","image_max_x":540,"image_max_y":800,"err":"NotFoundException: startSize = 0","errVerbose":"NotFoundException: startSize = 0 【or startSize =2】

makiuchi-d commented 5 years ago

The QR-Code must contains three finder patterns. Why don't you show me THE IMAGE?

childeYin commented 5 years ago

The QR-Code must contains three finder patterns. Why don't you show me THE IMAGE?

beacuse, image is online by user send, but offline test, it's ok