[TIMOB-25849] Android: openPhotoGallery - width and height = 0 in 7.1.0 RC
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-03-08T23:01:02.000+0000 |
Affected Version/s | Release 7.1.0, Release 7.0.2 |
Fix Version/s | Release 7.1.0 |
Components | Android |
Labels | 7.1.0RC, android, regression |
Reporter | Luc-Edmond Gaspard |
Assignee | Gary Mathews |
Created | 2018-03-08T04:22:31.000+0000 |
Updated | 2018-03-14T18:00:35.000+0000 |
Description
After choosing a photo from the gallery, e.media.width and e.media.height are set to 0 in the success callback. Theses values were available in 7.0.2 and before.
var win = Ti.UI.createWindow();
var button = Ti.UI.createButton({
title: "open gallery",
});
button.addEventListener("click", function(){
Ti.Media.openPhotoGallery({
mediaTypes: [Titanium.Media.MEDIA_TYPE_PHOTO],
success: function(e) {
var msg = "media.width: " + e.media.width
+ "\nmedia.height: " + e.media.height
+ "\nmedia.length: " + e.media.length
+ "\nmedia.mimeType: " + e.media.mimeType
+ "\nmedia.nativePath: " + e.media.nativePath;
alert(msg);
},
error: function(e) {
alert('Error opening image: ' + e.error);
}
});
});
win.add(button);
win.open();
Hello [~gaspard.le], Thanks for sharing this. Do you experience this on all android devices or specific one?
All the ones I tested. Emulator, Galaxy S5 ,Galaxy S8, Moto G.
master: https://github.com/appcelerator/titanium_mobile/pull/9918 7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9919
FR Passed. PR's merged.
Verified the fix in SDK 7.1.0.v20180308150545 & 7.2.0.v20180313125304. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 --- Android 6.0.1 ⇨ google Nexus 6P --- Android 8.0.0