Skip to content

Commit

Permalink
Merge pull request #242 from DisruptiveMind/master
Browse files Browse the repository at this point in the history
CB-11714: (windows) added check for encoding in savePhoto() without height/width
  • Loading branch information
Chris Brody committed Oct 3, 2018
2 parents a346212 + c1b9772 commit dc73954
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/windows/CameraProxy.js
Expand Up @@ -785,6 +785,11 @@ function savePhoto (picture, options, successCallback, errorCallback) {
if (options.targetHeight > 0 && options.targetWidth > 0) {
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
if (options.encodingType === Camera.EncodingType.PNG) {
picture.name = picture.name.replace(/\.png$/, '.jpg');
}

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

0 comments on commit dc73954

Please sign in to comment.