aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-01-15 12:57:49 +0100
committersteckbrief <steckbrief@chefmail.de>2016-01-15 12:57:49 +0100
commit2a14176b803e49cb21e3a8e562eaf10cf47718b4 (patch)
tree039e1ffb1a513ec26581faec783a7d751c06bada
parent0e2cd3e14208780c09281bf5ad05cb7d657e261a (diff)
Implements FS#111: Compress resized picture with PNG format
-rw-r--r--Conversations-Plus-ChangeLog.md1
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/persistance/FileBackend.java6
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);
}