Skip to content

Instantly share code, notes, and snippets.

@Pethaf
Created August 5, 2017 18:23
Show Gist options
  • Save Pethaf/06c7379562d4ae99330d4d9ac0e9e537 to your computer and use it in GitHub Desktop.
Save Pethaf/06c7379562d4ae99330d4d9ac0e9e537 to your computer and use it in GitHub Desktop.
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
Bitmap bitmap = BitmapFactory.decodeFile(files[0], options);
if (options.outWidth != -1 && options.outHeight != -1) {
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inJustDecodeBounds = false;
bitmap = BitmapFactory.decodeFile(files[0],options);
originalImage.setImageBitmap(bitmap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment