-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
二维码解析失败 #87
Comments
因为改变了探测图形,zxing原生库识别率低,暂无解决办法(话说微信的二维码识别挺牛逼的,不知道怎么做的) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
用的使用手册里的二维码
![image](https://user-images.githubusercontent.com/39852370/109015477-1ca90680-76f0-11eb-887e-6fa330c0edc4.png)
代码
public Map qr(MultipartFile img) throws IOException, FormatException, ChecksumException, NotFoundException { Map<String,String> hashMap = new HashMap<>(); log.info(img.getOriginalFilename()); BufferedImage qrImg = ImageIO.read(img.getInputStream()); LuminanceSource source = new BufferedImageLuminanceSource(qrImg); BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); QRCodeReader qrCodeReader = new QRCodeReader(); Result result = qrCodeReader.decode(bitmap); hashMap.put("res",result.getText()); return hashMap; }
报错如下
{ "timestamp": "2021-02-24T14:24:38.823+00:00", "status": 500, "error": "Internal Server Error", "trace": "com.google.zxing.NotFoundException\r\n", "message": "No message available", "path": "/qrdecode" }
普通的二维码没事。
The text was updated successfully, but these errors were encountered: