summary refs log tree commit diff
path: root/webclient/components/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'webclient/components/utilities')
-rw-r--r--webclient/components/utilities/utilities-service.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/webclient/components/utilities/utilities-service.js b/webclient/components/utilities/utilities-service.js
index 5e9f707221..3df2f04458 100644
--- a/webclient/components/utilities/utilities-service.js
+++ b/webclient/components/utilities/utilities-service.js
@@ -103,7 +103,9 @@ angular.module('mUtilities', [])
                 var ctx = canvas.getContext("2d");
                 ctx.drawImage(img, 0, 0, width, height);
 
-                var dataUrl = canvas.toDataURL("image/jpeg", 0.7); 
+                // Extract image data in the same format as the original one.
+                // The 0.7 compression value will work with formats that supports it like JPEG.
+                var dataUrl = canvas.toDataURL(imageFile.type, 0.7); 
                 deferred.resolve(self.dataURItoBlob(dataUrl));
             };
             img.onerror = function(e) {