diff --git a/plugin.xml b/plugin.xml index f2f8368..f637e5c 100755 --- a/plugin.xml +++ b/plugin.xml @@ -12,6 +12,7 @@ + diff --git a/src/android/Thumbnails.java b/src/android/Thumbnails.java index 4ba04a1..cb65cc4 100755 --- a/src/android/Thumbnails.java +++ b/src/android/Thumbnails.java @@ -19,7 +19,7 @@ public class Thumbnails { - public static void thumbnail(Options thumbnailOptions) throws IOException { + public static void thumbnail(Options thumbnailOptions) throws Exception { long begin = System.currentTimeMillis(); Bitmap bitmap = thumbnailSmallImage(thumbnailOptions); @@ -37,12 +37,16 @@ public static void thumbnail(Options thumbnailOptions) throws IOException { bitmap = null; } - private static Bitmap thumbnailSmallImage(Options thumbnailOptions) throws IOException { + private static Bitmap thumbnailSmallImage(Options thumbnailOptions) throws Exception { BitmapFactory.Options options = calculateImageSize(thumbnailOptions.sourcePath); options.inJustDecodeBounds = false; Bitmap bitmap = BitmapFactory.decodeFile(thumbnailOptions.sourcePath, options); + if (bitmap == null) { + throw new Exception("Could not decode file into bitmap object { sourcePath: " + thumbnailOptions.sourcePath + " options: }"); + } + long begin = System.currentTimeMillis(); int oWidth = bitmap.getWidth(); int oHeight = bitmap.getHeight();