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 --- .../de/thedevstack/conversationsplus/persistance/FileBackend.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/persistance') 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