From 0b2d58470bdb3c1fd45748f786b7f169547a22b5 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 02:57:36 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E6=9B=BF=E3=81=A8=E3=81=97=E3=81=A6St?= =?UTF-8?q?ore=E3=81=A7=E7=AE=A1=E7=90=86=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/source/file/impl/FileManagerImpl.java | 3 ++- utils/src/main/java/one/nem/lacerta/utils/Store.java | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 utils/src/main/java/one/nem/lacerta/utils/Store.java 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 b8f5226c..03f9332b 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 @@ -22,6 +22,7 @@ import dagger.assisted.AssistedInject; import one.nem.lacerta.source.file.FileManager; import one.nem.lacerta.utils.LacertaLogger; +import one.nem.lacerta.utils.Store; public class FileManagerImpl implements FileManager { @@ -303,7 +304,7 @@ public class FileManagerImpl implements FileManager { private void saveBitmapInternal(Bitmap bitmap, Path path) throws IOException { try { logger.debug("saveBitmapInternal", "path: " + path); - bitmap.compress(Bitmap.CompressFormat.PNG, 100, Files.newOutputStream(path)); + bitmap.compress(Bitmap.CompressFormat.PNG, Store.Scan.PNG_QUALITY, Files.newOutputStream(path)); } catch (Exception e) { logger.error("saveBitmapInternal", e.getMessage()); throw new IOException("Failed to save bitmap"); diff --git a/utils/src/main/java/one/nem/lacerta/utils/Store.java b/utils/src/main/java/one/nem/lacerta/utils/Store.java new file mode 100644 index 00000000..78bc2511 --- /dev/null +++ b/utils/src/main/java/one/nem/lacerta/utils/Store.java @@ -0,0 +1,7 @@ +package one.nem.lacerta.utils; + +public class Store { + public class Scan { + public static final int PNG_QUALITY = 60; + } +}