Image: perfs improvement
[nikiroo-utils.git] / src / be / nikiroo / utils / android / ImageUtilsAndroid.java
index eb65ff135dd26bc4e7a659a04d48a4b8ea1a5985..f198862437754f0883d6ecc77dbacf03c55d4eb7 100644 (file)
@@ -62,8 +62,9 @@ public class ImageUtilsAndroid extends ImageUtils {
         *             in case of IO error
         */
        static public Bitmap fromImage(Image img) throws IOException {
-               int size = img.getData().length;
-               Bitmap image = BitmapFactory.decodeByteArray(img.getData(), 0, size);
+               byte[] array = img.getData();
+               int size = array.length;
+               Bitmap image = BitmapFactory.decodeByteArray(array, 0, size);
                if (image == null) {
                        String ssize = StringUtils.formatNumber(size);
                        throw new IOException(