Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24869] Windows: ShowCamera should not write image to photoGallery by default

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-08-17T14:43:28.000+0000
Affected Version/sRelease 6.1.0, Release 6.1.1
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelsparity
ReporterEwan Harris
AssigneeKota Iguchi
Created2017-06-21T11:40:17.000+0000
Updated2017-08-21T10:37:13.000+0000

Description

Description

Currently when using Ti.Media.showCamera, the photo will be saved to the users photo gallery by default, regardless of the saveToPhotoGallery setting. By default the file should not be saved to the photo gallery
var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }),
    openButton = Ti.UI.createButton({ title: 'OPEN CAMERA', backgroundColor: 'blue', top: 25 });
openButton.addEventListener('click', function () {
    Ti.Media.showCamera({
        success: function (e) {
            var img = Ti.UI.createImageView({
                image: e.media
            });
            win.add(img);
        },
        error: function (e) {
            alert('showCamera() error: ' + JSON.stringify(e));
        }
    });
});
win.add(openButton);
win.open();

Steps to reproduce

Add the code above to an existing app.js

Build for Windows

Tap the show camera button and take a photo

Add the following to your tiapp under the windows section

<manifest>
    <Capabilities>
        <uap:Capability Name="picturesLibrary" />
        <uap:Capability Name="videosLibrary" />
    </Capabilities>
</manifest>
5. Rebuild and repeat the steps

Actual

Without the capabilities, after taking the photo the app will throw an access denied in the alert. With the capabilities a photo will be added to the window, and to the devices photo gallery

Expected

A photo should be added in both cases, neither should add the photo to the photo gallery

Comments

  1. Kota Iguchi 2017-07-07

    https://github.com/appcelerator/titanium_mobile_windows/pull/1036
  2. Kota Iguchi 2017-08-18

    Merged to 6_2_X https://github.com/appcelerator/titanium_mobile_windows/pull/1079
  3. Ewan Harris 2017-08-21

    Verified in 6.2.0.v20170821001430, closing ticket

JSON Source