From d01bd74eac36d142e95fb17a2f562e94fdf7299f Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sat, 18 May 2019 15:01:21 +0200 Subject: [PATCH] fix ImageUtils/Android --- src/be/nikiroo/utils/ImageUtils.java | 2 +- src/be/nikiroo/utils/android/ImageUtilsAndroid.java | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/be/nikiroo/utils/ImageUtils.java b/src/be/nikiroo/utils/ImageUtils.java index e95f73e4..fb869294 100644 --- a/src/be/nikiroo/utils/ImageUtils.java +++ b/src/be/nikiroo/utils/ImageUtils.java @@ -211,7 +211,7 @@ public abstract class ImageUtils { if (obj.check()) { return obj; } - } catch (Exception e) { + } catch (Throwable e) { } } diff --git a/src/be/nikiroo/utils/android/ImageUtilsAndroid.java b/src/be/nikiroo/utils/android/ImageUtilsAndroid.java index d55e602c..f50af005 100644 --- a/src/be/nikiroo/utils/android/ImageUtilsAndroid.java +++ b/src/be/nikiroo/utils/android/ImageUtilsAndroid.java @@ -10,8 +10,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.stream.Stream; -import javax.imageio.ImageIO; - import be.nikiroo.utils.Image; import be.nikiroo.utils.ImageUtils; import be.nikiroo.utils.StringUtils; @@ -26,7 +24,7 @@ public class ImageUtilsAndroid extends ImageUtils { @Override protected boolean check() { // If we can get the class, it means we have access to it - Config.ALPHA_8; + Config c = Config.ALPHA_8; return true; } @@ -82,10 +80,10 @@ public class ImageUtilsAndroid extends ImageUtils { throw new IOException( "Failed to convert input to image, size was: " + ssize); } + + return image; } finally { stream.close(); } - - return image; } } -- 2.27.0