From 2ddd803683ebd2edb4e597d6e58f88fab178b0d7 Mon Sep 17 00:00:00 2001 From: kollerlukas Date: Tue, 28 Feb 2017 22:17:43 -0800 Subject: [PATCH] - v1.2.1 Beta release - fixed crash, when trying to print to big images --- app/build.gradle | 4 ++-- .../java/us/koller/cameraroll/ui/ItemActivity.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bd871127..9caaa7e4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.koller.cameraroll" minSdkVersion 19 targetSdkVersion 25 - versionCode 12 - versionName "v1.2 Beta" + versionCode 13 + versionName "v1.2.1 Beta" renderscriptTargetApi 25 renderscriptSupportModeEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/us/koller/cameraroll/ui/ItemActivity.java b/app/src/main/java/us/koller/cameraroll/ui/ItemActivity.java index 3de39625..59083910 100644 --- a/app/src/main/java/us/koller/cameraroll/ui/ItemActivity.java +++ b/app/src/main/java/us/koller/cameraroll/ui/ItemActivity.java @@ -49,6 +49,7 @@ import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -431,8 +432,13 @@ public void printPhoto() { PrintHelper photoPrinter = new PrintHelper(this); photoPrinter.setScaleMode(PrintHelper.SCALE_MODE_FIT); - Bitmap bitmap = BitmapFactory.decodeFile(albumItem.getPath()); - photoPrinter.printBitmap(albumItem.getPath(), bitmap); + try { + photoPrinter.printBitmap(albumItem.getPath(), + albumItem.getUri(this)); + } catch (FileNotFoundException e) { + Toast.makeText(this, "Error", Toast.LENGTH_SHORT).show(); + e.printStackTrace(); + } } public void editPhoto() {