-
Notifications
You must be signed in to change notification settings - Fork 18
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
java.lang.IllegalArgumentException: width and height must be > 0 #31
Comments
You probably trying to create logo with zero size. Anyway i need a code snippet to reproduce |
The error from production app.
|
Again got the same issue in following models Android 13 Android 12 Android 11 Library version: Code Snippet
Exception caught Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0 |
|
Put a default size
Because if you're dealing with a Drawable generated dynamically and not from a resource, obtaining intrinsic dimensions might not be straightforward. In such cases, we can use a default size or set a reasonable size for the bitmap if intrinsic dimensions are not available |
Yes but that code from SDK, so @alexzhirkevich can fix it. This is my code
|
Describe the bug
at android.graphics.Bitmap.createBitmap (Bitmap.java:1111)
at android.graphics.Bitmap.createBitmap (Bitmap.java:1078)
at android.graphics.Bitmap.createBitmap (Bitmap.java:1028)
at android.graphics.Bitmap.createBitmap (Bitmap.java:989)
at androidx.core.graphics.drawable.DrawableKt.toBitmap (Drawable.kt:68)
at com.github.alexzhirkevich.customqrgenerator.style.BitmapScale$FitXY.scale (BitmapScale.kt:24)
at com.github.alexzhirkevich.customqrgenerator.vector.QrCodeDrawableImpl.createLogo (QrCodeDrawable.kt:522)
at com.github.alexzhirkevich.customqrgenerator.vector.QrCodeDrawableImpl.resize (QrCodeDrawable.kt:734)
at com.github.alexzhirkevich.customqrgenerator.vector.QrCodeDrawableImpl.setBounds (QrCodeDrawable.kt:159)
Versions
Library : 1.6.2'
Android: 12,13
The text was updated successfully, but these errors were encountered: