Comments (5)
Probably content is too big. Need a code snippet to reproduce
from custom-qr-generator.
Got it, i will watch this error in other devices and let you know. I am generating Qr code with UTF-8 charset.
from custom-qr-generator.
When data is big can you throw that exception so we can display message or do something when exception occurred . Right now app is crashing when data is too big.
QrCodeDrawableImpl(
data: QrData,
private val options: QrVectorOptions,
charset: Charset?=null
) : Drawable() {
private var anchorCenters: List<Pair<Int, Int>>
private val initialMatrix: QrCodeMatrix
private val shapeIncrease : Int
init {
val code = Encoder.encode( **<=== if you can throw writer exception or catch it if possible.**
data.encode(),
with(options.errorCorrectionLevel) {
if (this == QrErrorCorrectionLevel.Auto)
fit(options.logo, options.codeShape).lvl
else lvl
},
charset?.let {
mapOf(EncodeHintType.CHARACTER_SET to it)
})
from custom-qr-generator.
Caused by com.google.zxing.WriterException:
at com.google.zxing.qrcode.encoder.Encoder.chooseVersion (Encoder.java:313)
at com.google.zxing.qrcode.encoder.Encoder.recommendVersion (Encoder.java:213)
at com.google.zxing.qrcode.encoder.Encoder.encode (Encoder.java:147)
at com.github.alexzhirkevich.customqrgenerator.vector.QrCodeDrawableImpl. (QrCodeDrawable.kt:44)
at com.github.alexzhirkevich.customqrgenerator.vector.QrCodeDrawableKt.QrCodeDrawable (QrCodeDrawable.kt:29)
There is an exception already. Why do i need to throw another one.
You can catch this exception and display anything you want
from custom-qr-generator.
Yeah but its unchecked so writing try catch with WriterException gives error any way i will do with base exception class thanks for your time.
from custom-qr-generator.
Related Issues (20)
- Add QrVectorPixelShape.Square(size) shape modifier HOT 3
- How to use your library draw QR codes with 3 vertices and circles? Looking forward to your reply HOT 5
- Support the different standard encodings HOT 7
- Expose reserved areas HOT 15
- Customizing QR code after generation HOT 4
- Is the size of the positioning markings adjustable? HOT 4
- How to remove icon and background after choose them HOT 2
- How to custom gradient color and select background, logo from devices HOT 6
- Highlight anchor elements for better recognition seems break in Library version 2.0.0-alpha01 HOT 8
- add jetpack compose support to the library HOT 5
- Any Java samples? HOT 3
- Generated QR not scan-able HOT 6
- I run the app module of this project, and input "123" ,but it can't be scanned by other qr scanner. HOT 4
- [BUG] Documentation and Source Code is not published
- Publish apks on GitHub HOT 2
- [BUG] The code in example is invalid
- overlay image on qrCode HOT 8
- Change background and dots
- Help Implementing HOT 4
- how to store in room database HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from custom-qr-generator.