try Bitmap.createScaledBitmap
bitmap = Bitmap.createScaledBitmap(songCover, 300, 300, true);
And you can keep the same aspect ratio for the old image ... I use the following logic:
int width = songCover.getWidth(); int height = songCover.getHeight(); float scaleHeight = (float)height/(float)300; float scaleWidth = (float)width /(float)300; if (scaleWidth < scaleHeight) scale = scaleHeight; else scale = scaleWidth; bitmap = Bitmap.createScaledBitmap(songCover, (int)(width/scale), (int)(height/scale), true);
source share