summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets/widgets.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js/widgets/widgets.js')
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js
index d7662951999..92ebf9ec4fe 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -1589,10 +1589,10 @@ var CropImageDialog = Dialog.extend({
];
this.imageData = {
imageSrc: src,
- originalSrc: src, // the original src for cropped DB images will be fetched later
- mimetype: _.str.endsWith(src, '.png') ? 'image/png' : 'image/jpeg', // the mimetype for DB images will be fetched later
+ originalSrc: this.$media.data('crop:originalSrc') || src, // the original src for cropped DB images will be fetched later
+ mimetype: this.$media.data('crop:mimetype') || (_.str.endsWith(src, '.png') ? 'image/png' : 'image/jpeg'), // the mimetype for DB images will be fetched later
aspectRatio: this.$media.data('aspectRatio') || this.aspectRatioList[0][1],
- isExternalImage: src[0] !== '/' && src.indexOf(window.location.host) < 0,
+ isExternalImage: src.substr(0, 5) !== 'data:' && src[0] !== '/' && src.indexOf(window.location.host) < 0,
};
this.options = _.extend({
title: _t("Crop Image"),