Recycle Bitmap in transformation
This commit is contained in:
parent
fcef783bbb
commit
314964c5f9
1 changed files with 7 additions and 1 deletions
|
@ -1235,12 +1235,18 @@ public final class Player implements
|
||||||
context.getResources()
|
context.getResources()
|
||||||
.getDimension(R.dimen.player_notification_thumbnail_width),
|
.getDimension(R.dimen.player_notification_thumbnail_width),
|
||||||
source.getWidth());
|
source.getWidth());
|
||||||
return Bitmap.createScaledBitmap(
|
|
||||||
|
final Bitmap result = Bitmap.createScaledBitmap(
|
||||||
source,
|
source,
|
||||||
(int) notificationThumbnailWidth,
|
(int) notificationThumbnailWidth,
|
||||||
(int) (source.getHeight()
|
(int) (source.getHeight()
|
||||||
/ (source.getWidth() / notificationThumbnailWidth)),
|
/ (source.getWidth() / notificationThumbnailWidth)),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
if (result != source) {
|
||||||
|
source.recycle();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue