BitmapMerger icon indicating copy to clipboard operation
BitmapMerger copied to clipboard

wrong scale parameter of overlay bitmap

Open toandk opened this issue 9 years ago • 1 comments

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 avatar Mar 17 '16 03:03 toandk

@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

sharish avatar Mar 21 '16 06:03 sharish