Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(function (resolve) {
BlobConversions.blobToImage(blob).
then(function (newImage) {
const newSize = ImageSize.getNaturalImageSize(newImage);
if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) {
if (ImageSize.getImageSize(img)) {
ImageSize.setImageSize(img, newSize);
}
}
URL.revokeObjectURL(newImage.src);
return blob;
}).
then(ResultConversions.blobToImageResult).
then(function (imageResult) {
return updateSelectedImage(editor, imageResult, true, imageUploadTimerState, img);
}, function () {