今天在玩二维码识别时,报错:com.google.zxing.NotFoundException

经过网上冲浪得以解决 ,原因竟然是精度问题导致。由于二维码中带有图片。

// 解码设置编码方式为:utf-8,

hints.put(DecodeHintType.CHARACTER_SET, CHARSET);

//优化精度

hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);

//复杂模式,开启PURE_BARCODE模式

hints.put(DecodeHintType.PURE_BARCODE, Boolean.TRUE);

配置以下三个配置项,问题得以解决

转载于:https://www.sojson.com/blog/183.html

GitHub 加速计划 / zx / zxing
32.53 K
9.31 K
下载
ZXing ("Zebra Crossing") barcode scanning library for Java, Android
最近提交(Master分支:2 个月前 )
8944e607 3 个月前
6ea3726b Bumps `spring.version` from 6.1.5 to 6.1.8. Updates `org.springframework:spring-test` from 6.1.5 to 6.1.8 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.5...v6.1.8) Updates `org.springframework:spring-web` from 6.1.5 to 6.1.8 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.5...v6.1.8) --- updated-dependencies: - dependency-name: org.springframework:spring-test dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.springframework:spring-web dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sean Owen <srowen@gmail.com> 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐