Comments (12)
Heya! Thanks for bringing up this issue! I'll give it a try later today and I'll get back to you 😄
Might be something due to the optimization implemented.
Also, I'm working on implementing examples with all platforms of the library, but I'll definitely add a Jetpack Compose one! Thanks for suggesting it ^^
from qrcode-kotlin.
I think this is also related to our issue. We had:
Image(
modifier = Modifier.padding(8.dp),
bitmap = (QRCode(barcode).render().nativeImage() as Bitmap).asImageBitmap(),
alpha = if (expired) 0.38f else 1.0f,
contentDescription = stringResource(R.string.alt_qr_code)
)
And this worked fine in v3.x.x but with v4.0.2 and the QRCodeProcessor
instead of QRCode
we now just get a black square with no white at all.
from qrcode-kotlin.
Heya, I pinpointed the issue. I'm not 100% sure of what caused it, but it is because the Int
s of the colors are kind of being compiled wrong on Android. Color.WHITE
for example goes from 0xFFFFFFFF
to -1
which makes it black... and basically the same for all other colors 🤔
Still figuring out how to fix it x_x
from qrcode-kotlin.
🤦♂️ found the issue, preparing the next version with the fix
In short, either I'm dumb or Android API is. Thing is, rectangles are described via:
(x1, y1)
of the top-left corner and (x2, y2)
of the bottom right corner. I assumed, as all other platforms works like this, that they were x, y, width, height
...
This is what causes this weird "everything is black" state.
Edit: Now that the library draws all squares directly into the Canvas, this was what caused the issue: any black rectangles would become something like "draw from 1000,1000 to -20,-20"
from qrcode-kotlin.
@g0dkar I can confirm that the QR code now looks good in Compose (for my scenario at least)
from qrcode-kotlin.
I see! That really seems like it is related, I'll try this out right now
from qrcode-kotlin.
Might not be that, btw... Anyway, I'm still trying to figure out what is going on O_o
from qrcode-kotlin.
Also, I'll make a few adjustments to the compatibility API for the use-case @barry-irvine shared :)
Right now, since the innerSpace
is being defaulted to 1
, the QRCodes might end up looking like this:
from qrcode-kotlin.
This should fix both reported issues. I'll keep this issue open since I didn't implement Jetpack Compose examples yet 😅
from qrcode-kotlin.
Related Issues (20)
- `BufferedImage` class not found HOT 1
- [iOS] Missing target for iOSX64 for 4.1.0 HOT 1
- Qrcode Version HOT 1
- some typos in installation and usage guide (alguns erros de Digitação nos guias de instalação e uso) HOT 3
- Make error correction configurable HOT 2
- Internet Required HOT 1
- RoundQRCode.kt Not working as expected HOT 1
- Tag releases
- Native target support for KMM project HOT 9
- Dependency Dashboard
- How To Decode QR HOT 1
- can't find the documentation HOT 2
- QRCode in fixed size? HOT 1
- Do you have a plan to support generating qr code with logo? HOT 2
- [v4.0.1] iOS and tvOS Feedback HOT 4
- Would it possible to support 1D barcode? HOT 1
- Android minimum version requirement HOT 10
- Issue when compiling for iosArm64 HOT 4
- QR codes not being generated properly for iOS 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 qrcode-kotlin.