diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-01-15 12:57:49 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-01-15 12:57:49 +0100 |
commit | 2a14176b803e49cb21e3a8e562eaf10cf47718b4 (patch) | |
tree | 039e1ffb1a513ec26581faec783a7d751c06bada /src/main | |
parent | 0e2cd3e14208780c09281bf5ad05cb7d657e261a (diff) |
Implements FS#111: Compress resized picture with PNG format
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/persistance/FileBackend.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/persistance/FileBackend.java b/src/main/java/de/thedevstack/conversationsplus/persistance/FileBackend.java index 0a118ccb..d58d0583 100644 --- a/src/main/java/de/thedevstack/conversationsplus/persistance/FileBackend.java +++ b/src/main/java/de/thedevstack/conversationsplus/persistance/FileBackend.java @@ -47,7 +47,7 @@ public final class FileBackend { extension = "."+parts[parts.length - 1]; } else { if (message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_TEXT) { - extension = ".webp"; + extension = ".png"; } else { extension = ""; } @@ -120,7 +120,7 @@ public final class FileBackend { } public static DownloadableFile compressImageAndCopyToPrivateStorage(Message message, Bitmap scaledBitmap) throws FileCopyException { - message.setRelativeFilePath(FileBackend.getPrivateImageDirectoryPath() + message.getUuid() + ".webp"); + message.setRelativeFilePath(FileBackend.getPrivateImageDirectoryPath() + message.getUuid() + ".png"); DownloadableFile file = getFile(message); file.getParentFile().mkdirs(); OutputStream os = null; @@ -128,7 +128,7 @@ public final class FileBackend { file.createNewFile(); os = new FileOutputStream(file); - boolean success = scaledBitmap.compress(Bitmap.CompressFormat.WEBP, 75, os); + boolean success = scaledBitmap.compress(Bitmap.CompressFormat.PNG, 75, os); if (!success) { throw new FileCopyException(R.string.error_compressing_image); } |