[TIMOB-23125] Windows: getting photo from gallery fails
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-06-28T03:45:07.000+0000 |
Affected Version/s | Release 5.2.1 |
Fix Version/s | Release 5.4.0 |
Components | Windows |
Labels | gallery, image, media, qe-5.4.0 |
Reporter | Zakhar Zhuravlev |
Assignee | Kota Iguchi |
Created | 2016-03-24T14:24:04.000+0000 |
Updated | 2016-06-28T17:08:07.000+0000 |
Description
It's affected 5.2.0
Error code: -1;
Error message: 'Failed to load content from file'
*index.js:*
{noformat}
function onTest() {
Titanium.Media.openPhotoGallery({
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
success: function(e) {
$.imageView.image = e.media;
},
error: function(error) {
Titanium.UI.createAlertDialog({
title: error.code,
message: error.error,
ok: 'ok'
}).show();
}
});
}
$.win.open();
*index.xml:*
{noformat}
There are two issues related to this. One is you needed to configure
picturesLibrary
capability intiapp.xml
to enable permission to access Windows photo library. The other issue is TIMOB-23115, because of thatImageView
doesn't acceptBlob
. So this issue actually depends on TIMOB-23115. Also we'll need to update the document so we can find appropriate configuration easily.Confirmed that latest CI build (5.4.0.v20160331110910) fixes the issue. You can checkout latest build via
ti sdk install -b master -d
. Note that you'll need to setpicturesLibrary
to yourtiapp.xml
to get access to Windows pictures library like blow.I am still able to reproduce this issue using: *Device:* Windows Phone 10.0 *Node.js Version:* 4.4.4 *npm Version:* 4.2.7-2 *Titanium SDK:* 5.4.0.v20160608165242 *Appcelerator CLI Version:* 5.4.0-15 *Appcelerator Studio:* 4.6.0.201605201934 I have added the code below the the TiApp and used the demo code in the comments above:
*Reopening ticket*
Turns out it's a regression. 5_4_X: https://github.com/appcelerator/titanium_mobile_windows/pull/742 master: https://github.com/appcelerator/titanium_mobile_windows/pull/743
Sounds like Ewan was able to confirm the fix, so I merged the fixes to 5_4_X and master.
I am still able to reproduce this issue application crashes or just shows a black screen using: *Device:* Windows Phone 10.0, 8.1 *Node.js Version:* 4.4.4 *npm Version:* 4.2.7-2 *Titanium SDK:* 5.4.0.v20160627120037 *Appcelerator CLI Version:* 5.4.0-18 *Appcelerator Studio:* 4.7.0.201606150733 *App.js*
*Added to the Tiapp.xml*
*Reopening*
[~jlongton] I was able to reproduce the crash, and it turns out it was because of
JSON.stringify
againstBlob
. When I removeJSON.stringify
fromsuccess
callback, it went through well for me. Can you try following?So if that's the case, it is because of
Blob
, not because ofTi.Media.openPhotoGallery
. I would resolve this ticket, and create new ticket for Blob: TIMOB-23568Verified as fixed. Tested on: Microsoft Lumia 640 (8.1) Microsoft Lumia 640 (10) Windows 10 Pro Studio: 4.7.0.201606150733 Ti SDK: 5.4.0.v20160627224205 Appc NPM: 4.2.7-2 App CLI: 5.4.0-20 Node v4.4.4 *Closing Ticket.*