Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25849] Android: openPhotoGallery - width and height = 0 in 7.1.0 RC

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-03-08T23:01:02.000+0000
Affected Version/sRelease 7.1.0, Release 7.0.2
Fix Version/sRelease 7.1.0
ComponentsAndroid
Labels7.1.0RC, android, regression
ReporterLuc-Edmond Gaspard
AssigneeGary Mathews
Created2018-03-08T04:22:31.000+0000
Updated2018-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();

Comments

  1. Mostafizur Rahman 2018-03-08

    Hello [~gaspard.le], Thanks for sharing this. Do you experience this on all android devices or specific one?
  2. Luc-Edmond Gaspard 2018-03-08

    All the ones I tested. Emulator, Galaxy S5 ,Galaxy S8, Moto G.
  3. Gary Mathews 2018-03-08

    master: https://github.com/appcelerator/titanium_mobile/pull/9918 7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9919
  4. Lokesh Choudhary 2018-03-08

    FR Passed. PR's merged.
  5. Lokesh Choudhary 2018-03-14

    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

JSON Source