Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10566] iOS: Add 'autorotate' property to imageview

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-09-18T13:28:46.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-19 API, 2012 Sprint 19
ComponentsiOS
LabelsImageView, api, parity, qe-review, qe-testadded
ReporterAllen Yeung
AssigneeVishal Duggal
Created2012-08-22T16:21:51.000+0000
Updated2013-01-09T19:53:31.000+0000

Description

Android recently added a property called 'autorotate' which will rotate the image inside an image view based on the exif data of the image. iOS does this by default, but we want to add this property to be able to disable it. Android has this flag false by default, and iOS will have it true by default. Since there are performance implications on the Android side, we can't have the same default value. You can use the following code with the attached image to test out this behavior:
var win = Titanium.UI.createWindow();

var image = Ti.UI.createImageView({
	autorotate: true,
	image: 's2.jpg'

})

win.add(image);
win.open();

Attachments

FileDateSize
s2.jpg2012-08-22T16:21:51.000+00002323112

Comments

  1. Vishal Duggal 2012-09-12

    Expanded test case
       
       var win1 = Titanium.UI.createWindow({
       	backgroundColor:'white',
       	title:'AUTOROTATE - TRUE'
       });
       var image1 = Ti.UI.createImageView({
           autorotate: true,
           image: 's2.jpg'
       })
        
       win1.add(image1);
       var win2 = Titanium.UI.createWindow({
       	backgroundColor:'white',
       	title:'AUTOROTATE - FALSE'
       });
       var image2 = Ti.UI.createImageView({
           autorotate: false,
           image: 's2.jpg'
       })
       win2.add(image2);
       var win3 = Titanium.UI.createWindow({
       	backgroundColor:'white',
       	title:'AUTOROTATE - UNDEFINED'
       });
       var image3 = Ti.UI.createImageView({
           image: 's2.jpg'
       })
       win3.add(image3);
       
       var tab1 = Ti.UI.createTab({
       	title:'TAB1',
       	window:win1
       })
       var tab2 = Ti.UI.createTab({
       	title:'TAB2',
       	window:win2
       })
       var tab3 = Ti.UI.createTab({
       	title:'TAB3',
       	window:win3
       })
       var tabGrp = Ti.UI.createTabGroup();
       tabGrp.addTab(tab1);
       tabGrp.addTab(tab2);
       tabGrp.addTab(tab3);
       tabGrp.open();
       
  2. Vishal Duggal 2012-09-12

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2924
  3. Tamila Smolich 2012-10-15

    Verified feature works as expected. Testing environment: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 3.0.0.201210090117 Titanium SDK, build: 3.0.0.v20121014234610 Device: Nexus 7 (4.1.2)

JSON Source