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 03f9332b..6077bf4e 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 @@ -304,7 +304,16 @@ 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, Store.Scan.PNG_QUALITY, Files.newOutputStream(path)); + // Bitmapの長辺を1024pxにする + int width = bitmap.getWidth(); + int height = bitmap.getHeight(); + float scale = 1.0f; + if (width > height) { + scale = Store.Scan.MAX_RESOLUTION_LONG / width; + } else { + scale = Store.Scan.MAX_RESOLUTION_LONG / height; + } + bitmap.compress(new Store.Scan().COMPRESS_FORMAT, Store.Scan.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/FeatureSwitch.java b/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java index 718c1aa8..91aab3eb 100644 --- a/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java +++ b/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java @@ -8,7 +8,7 @@ public class FeatureSwitch { public static class FeatureMaster { public static boolean enableSearch = false; - public static boolean enableDebugMenu = false; + public static boolean enableDebugMenu = true; } public static class Vcs { diff --git a/utils/src/main/java/one/nem/lacerta/utils/Store.java b/utils/src/main/java/one/nem/lacerta/utils/Store.java index 78bc2511..e2695ee1 100644 --- a/utils/src/main/java/one/nem/lacerta/utils/Store.java +++ b/utils/src/main/java/one/nem/lacerta/utils/Store.java @@ -1,7 +1,11 @@ package one.nem.lacerta.utils; +import android.graphics.Bitmap; + public class Store { - public class Scan { - public static final int PNG_QUALITY = 60; + public static class Scan { + public Bitmap.CompressFormat COMPRESS_FORMAT = Bitmap.CompressFormat.JPEG; + public static final int QUALITY = 60; + public static final float MAX_RESOLUTION_LONG = 2048; } }