From c28d94e41771e6394f31a5f06a086965a6547504 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 12:44:40 +0900 Subject: [PATCH] =?UTF-8?q?loadBitmapInternal,=20loadBitmap=E5=AE=9F?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/source/file/impl/FileManagerImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java index 849d69e2..81e0cd76 100644 --- a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java +++ b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java @@ -1,6 +1,7 @@ package one.nem.lacerta.source.file.impl; import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import org.w3c.dom.Document; @@ -222,6 +223,14 @@ public class FileManagerImpl implements FileManager { throw new IOException("Failed to load xml"); } } + private Bitmap loadBitmapInternal() throws IOException { + try { + return BitmapFactory.decodeFile(this.path.toString()); + } catch (Exception e) { + logger.error("loadBitmapInternal", e.getMessage()); + throw new IOException("Failed to load bitmap"); + } + } @Override public Document loadXml(String fileName) throws IOException { @@ -236,11 +245,12 @@ public class FileManagerImpl implements FileManager { @Override public Bitmap loadBitmap(String fileName) throws IOException { - return null; + this.resolve(fileName); + return this.loadBitmapInternal(); } @Override public Bitmap loadBitmap() throws IOException { - return null; + return this.loadBitmapInternal(); } }