Skip to content

wrong scale parameter of overlay bitmap #2

@toandk

Description

@toandk

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions