Skip to content
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

wrong scale parameter of overlay bitmap #2

Open
toandk opened this issue Mar 17, 2016 · 1 comment
Open

wrong scale parameter of overlay bitmap #2

toandk opened this issue Mar 17, 2016 · 1 comment

Comments

@toandk
Copy link

toandk commented Mar 17, 2016

I found a bug: Currently overlay bitmap is scaled by baseBitmap dimens
Line 217 of file BitmapmergerTask.java has to change from:
Bitmap overlayScaled = Bitmap.createScaledBitmap(overlayBitmap, (int) (baseBitmap.getWidth() * scale), (int) (baseBitmap.getHeight() * scale), true);
to
Bitmap overlayScaled = Bitmap.createScaledBitmap(overlayBitmap, (int) (overlayBitmap.getWidth() * scale), (int) (overlayBitmap.getHeight() * scale), true);

Another improvement:
Bitmap workingBitmap = Bitmap.createBitmap(baseBitmap); Bitmap mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888, true);
Above code generates 2 bitmaps and 'workingBitmap' is no need (waste of memory). We can modify it to:
Bitmap mutableBitmap = baseBitmap.copy(Bitmap.Config.ARGB_8888, true);

@sharish
Copy link
Owner

sharish commented Mar 21, 2016

@toandk Thanks for raising it. You can send a pull request modifying the above changes if you wish. I would take sometime to do it if you want me to change myself.

Thanks,
Harish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants