Skip to content

Commit

Permalink
CB-11714: reuse picture.name instead of pictureName
Browse files Browse the repository at this point in the history
  • Loading branch information
DisruptiveMind committed Sep 16, 2018
1 parent dca4b9c commit eb57b02
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/windows/CameraProxy.js
Expand Up @@ -801,13 +801,11 @@ function savePhoto(picture, options, successCallback, errorCallback) {
resizeImage(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight, options.encodingType);
} else {
// CB-11714: check if target content-type is PNG to just rename as *.jpg since camera is captured as JPEG
var pictureName = picture.name;

if (options.encodingType === Camera.EncodingType.PNG) {
pictureName = pictureName.replace(/\.png$/, ".jpg");
picture.name = picture.name.replace(/\.png$/, ".jpg");
}

picture.copyAsync(getAppData().localFolder, pictureName, OptUnique).done(function (copiedFile) {
picture.copyAsync(getAppData().localFolder, picture.name, OptUnique).done(function (copiedFile) {
successCallback('ms-appdata:///local/' + copiedFile.name);
}, errorCallback);
}
Expand Down

0 comments on commit eb57b02

Please sign in to comment.