From: Niki Roo Date: Sat, 18 May 2019 13:01:21 +0000 (+0200) Subject: fix ImageUtils/Android X-Git-Tag: fanfix-3.0.1~29^2~50 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=d01bd74eac36d142e95fb17a2f562e94fdf7299f;p=fanfix.git fix ImageUtils/Android --- diff --git a/src/be/nikiroo/utils/ImageUtils.java b/src/be/nikiroo/utils/ImageUtils.java index e95f73e..fb86929 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 d55e602..f50af00 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; } }