Skip to content
Permalink
Browse files
Merge pull request #242 from DisruptiveMind/master
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 dc7395410890be9e918e6a7cd05bc2dfabcd24fc
Showing 1 changed file with 5 additions and 0 deletions.
@@ -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);

0 comments on commit dc73954

Please sign in to comment.