From 2a14176b803e49cb21e3a8e562eaf10cf47718b4 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Fri, 15 Jan 2016 12:57:49 +0100 Subject: Implements FS#111: Compress resized picture with PNG format --- Conversations-Plus-ChangeLog.md | 1 + .../de/thedevstack/conversationsplus/persistance/FileBackend.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Conversations-Plus-ChangeLog.md b/Conversations-Plus-ChangeLog.md index f3ef617c..ca031f15 100644 --- a/Conversations-Plus-ChangeLog.md +++ b/Conversations-Plus-ChangeLog.md @@ -1,6 +1,7 @@ ###Conversations+ ChangeLog ####Version 0.0.6 +* Implements FS#111: Compress resized picture with PNG format * Fixes FS#107: Account can be edited while online * Implements FS#77: Open list of resources for own jid * Fixes FS#99: Adjust namespace according to XEP-0363 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); } -- cgit v1.2.3