alexzhirkevich / custom-qr-generator

Android library for creating QR codes with logo, custom shapes, colors, background image. Powered by ZXing
MIT License
173 stars 18 forks source link

Logo seems not cropped properly #26

Closed hardikbhalodi closed 1 year ago

hardikbhalodi commented 1 year ago

Describe the bug When set logo with Accurate or Natural padding (0.25) and its not cropping correctly and outline visible, also same issue for all shape circle or round rectangle etc. i tired with JPG and PNG logo, issue faced for both.

Versions Library : '1.6.1' Android: 13 Screenshot_20230419_113628 Screenshot_20230419_113643

Screenshot_20230419_113721 Screenshot_20230419_113704

alexzhirkevich commented 1 year ago

Try 8b2a97c5e6 snapshot

hardikbhalodi commented 1 year ago

Seem its fixed in 8b2a97c5e6 but when it is drawable its look strange check the images but after generate bitmap all good

BITMAP OUTPUT GOOD Screenshot_20230419_135925

DRAWABLE OUTPUT (Sometime good ) Screenshot_20230419_135539

alexzhirkevich commented 1 year ago

Only after 8b2a97c5e6 or it was before too?

hardikbhalodi commented 1 year ago

Before too!, i tried in 1.6.1 same and got same out put

hardikbhalodi commented 1 year ago

This happening when i am setting logo from phone gallery and convert selected Bitmap to Drawable using below code

Drawable d = new BitmapDrawable(getResources(), bitmap); <=== issue when using this

But i change to this code and all good now.

Drawable d = RoundedBitmapDrawableFactory.create(context.getResources(), bitmap); < === This code fixed the drawable issue.