Titanium JIRA Archive
Appcelerator Community (AC)

[AC-992] Android: Some token photos show up in the stock "photos app". saveToPhotoGallery option does not work

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2014-09-17T20:48:26.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsAndroid, Camera, Ti.Media.Camera
ReporterBar Bruy
AssigneeMauro Parra-Miranda
Created2014-09-16T12:14:25.000+0000
Updated2016-03-08T07:37:19.000+0000

Description

In android when I take pictures with option saveToPhotoGallery:false. Some pictures do show up in the app "photos" and are backed up to google+. To reproduce. Run the example code below. Take some pictures, switch to app "Photos" press refresh btn, go back take some pictures, go back to photos. I did it with 15 new pictures. And 3 of them showed up in google+
var win = Ti.UI.createWindow({title:'picture error revealer'});
win.open();

var directory = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'img');

var scrollView = Ti.UI.createScrollView({height:Ti.UI.FILL,width:Ti.UI.FILL,layout:'vertical',contentHeight: 'auto',showVerticalScrollIndicator: true,showHorizontalScrollIndicator: false,});
win.add(scrollView);

var addPictureButton = Ti.UI.createButton({title:'Add Picture',width:Ti.UI.SIZE,height:Ti.UI.SIZE});
addPictureButton.addEventListener('click',takePicture);
scrollView.add(addPictureButton);

function takePicture(){
    Ti.Media.showCamera({
        saveToPhotoGallery:false, //IMPORTANT PART
        success:processNewPicture,
        cancel:function(){Ti.API.error('picture got cancelled');},
        error:function(){Ti.API.error('error during take picture');},
        allowEditing:false,
        mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO],
    });
};
function processNewPicture(event){
    if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO && event.media) {
        var imageView = Ti.UI.createImageView({
            width:Ti.UI.FILL,
            height:120,top:5,
            image:event.media
        });
        scrollView.add(imageView);        
    }
    else
    {
        Ti.API.error('process new picture: wrong type or no media');   
    }
}

Comments

  1. Mauro Parra-Miranda 2014-09-17

    Hello, this should be a bug in Android. Check this answer: http://android.stackexchange.com/a/66774 Photos will check all over your phone for new pictures and will "backup them". Best Regards

JSON Source