Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5738] iOS openPhotoGallery method gives incorrect image when allowEditing is set to true

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2018-05-16T15:15:47.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterPrashant Saini
AssigneeShak Hossain
Created2018-05-16T06:00:01.000+0000
Updated2018-05-16T15:15:48.000+0000

Description

I was trying to crop the image using iOS inbuilt cropping feature for gallery/camera pictures. I had set the *allowEditing* to *true*, but the cropped image is incorrect and seems that cropping is being done from top-left corner instead of actual cropping area. Also tried by saving the cropped picture in device storage but it is incorrect there as well. Here's the sample code I used and the screenshots for the same.
var win = Ti.UI.createWindow({
        backgroundColor : 'white'
    });

    win.add(Ti.UI.createView({
        top : 0,
        height : 60,
        backgroundColor : '#1b56d1'
    }));

    win.add(Ti.UI.createLabel({
        top : 25,
        text : "Photo Editing Bug",
        font : {
            fontSize : 20,
            fontWeight : 'bold'
        },
        color : 'white'
    }));

    var image_view = Ti.UI.createImageView({
        bottom : 70,
        top : 70,
        left : 10,
        right : 10,
        backgroundColor : '#ddd'
    });

    var button = Ti.UI.createButton({
        title :'  TAKE PICTURE  ',
        bottom : 20,
        backgroundColor : 'blue',
        color : 'white'
    });

    button.addEventListener('click', function () {
        Ti.Media.openPhotoGallery({
            allowEditing : true,
            mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
            success : function (e) {
                image_view.image = e.media;
            }
        });
    });

    win.add(image_view);
    win.add(button);

    win.open();

Attachments

FileDateSize
1.png2018-05-16T05:58:36.000+000032340
2.png2018-05-16T05:58:45.000+0000862646
3.png2018-05-16T05:59:01.000+0000711935

Comments

  1. Mostafizur Rahman 2018-05-16

    Hello, Thanks for reporting this. Do you experience this in all devices? Please let us know and share us your detail environment information.
  2. Prashant Saini 2018-05-16

    I cannot test it on all devices due to unavailability. However I tested it only on iPhone 5s simulator on iOS 11.3 version. I am going to test it on a real iOS device tomorrow but even it should not behave improper on simulator as it never had earlier.
  3. Hans Knöchel 2018-05-16

    Hey there! This is a duplicate of TIMOB-25336, unfortunately a known Apple iOS bug.

JSON Source