Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10021] iOS: Cannot save rotated camera images after converting to Blob

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-07-19T14:47:36.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-15 API
ComponentsiOS
LabelsSupportTeam, api
ReporterVarun Joshi
AssigneeBlain Hamon
Created2012-07-18T09:29:58.000+0000
Updated2013-03-13T15:04:28.000+0000

Description

Comments

  1. Neeraj Gupta 2012-07-18

    Not sure if this is a valid use case but assigning it to engineering team for evaluation.
  2. Blain Hamon 2012-07-19

    Long term solution: Expose a method to rotate them directly. Perhaps as an external graphics module. Short term solution: Because of how computer graphics work, the transform is not applied until after the view is rendered. That is, an imageView's transform will NOT appear within its own toImage, but only in toImages of parent views. Thus, the following code DOES work:
       /********  capture image in a imageView  ********/
       var wrapperView = Ti.UI.createView();
       var imageView = Ti.UI.createImageView({  
             width:win.width,
             height:win.height,
             image:event.media
       });
       wrapperView.add(imageView);
       win.add(wrapperView);
           
       /******** rotate the imageView ************/
       var transformCurrentPicture = Titanium.UI.create2DMatrix();
         imageView.addEventListener('click',function(e){
             transformCurrentPicture = transformCurrentPicture.rotate(90);
             imageView.transform=transformCurrentPicture;
             savePhoto('Hello.png',wrapperView.toImage());   
       });
       
    Moving this be marked invalid, and, if so desired, a module feature request for image manipulations.
  3. Natalie Huynh 2012-12-04

    Closing as invalid

JSON Source