Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23522

Android: Portrait images get rotated using HTTPClient.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      SDK 5.2.2.G.A
      CLI 5.2.2
      Android platform

    • Story Points:
      1

      Description

      Hi all,

      I'm facing following issues using ImageView with XHR HTTPClient in Android.

      • Portrait images in ImageView gets rotated, while the image is fetched using XHR HTTP call.
      • If i don't make use of XHR call then the image is displayed perfectly.

      I also made use of autorotate property in XHR call but its not working.

      $.win1.addEventListener('open', function(e) {
      	var imageViewArray = [];
       
      	var imgView = Ti.UI.createImageView({
      		// height : "Titanium.UI.SIZE",
      		// width : "Titanium.UI.SIZE",
      		borderColor : "green",
      		autorotate : "true",
      		//	image : "https://jira.appcelerator.org/secure/attachment/36763/s2.jpg"			//Uncomment
      	});
      	
      	// **Comment below lines to check code without XHR call
      	var xhr = Ti.Network.createHTTPClient({
      		onload : function(e) {
      			//alert(JSON.stringify(xhr.responseData));
      			imgView.autorotate = "true";
      			imgView.image = xhr.responseData;
      		},
      		onerror : function(e) {
      		}
      	});
      	xhr.open('GET', "https://jira.appcelerator.org/secure/attachment/36763/s2.jpg");
      	xhr.send();
      	// **Comment lines till this section to check without XHR call
       
      	imageViewArray.push(imgView);
      	$.scrollableView.views = imageViewArray;
       
      });
      

      Expected Result:
      Portrait Image shouldn't get rotated while making XHR call.

      Actual Result:
      Portrait image gets rotated.

      Steps:

      1) Make XHR call to retrieve image. (Image displayed incorrectly)
      2) Comment XHR section & uncomment image line from ImageView. (Image displayed correctly)

      Thanks.

        Attachments

        1. index.js
          0.9 kB
        2. index.tss
          0.1 kB
        3. index.xml
          0.2 kB
        4. Screen Shot 2016-06-07 at 9.40.10 PM.png
          Screen Shot 2016-06-07 at 9.40.10 PM.png
          174 kB
        5. Screen Shot 2016-06-07 at 9.42.00 PM.png
          Screen Shot 2016-06-07 at 9.42.00 PM.png
          837 kB
        6. Screen Shot 2016-06-07 at 9.45.30 PM.png
          Screen Shot 2016-06-07 at 9.45.30 PM.png
          150 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Suraj Datta Suraj Datta
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-9828
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code