wrong scale parameter of overlay bitmap
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);
@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