Project: titanium
Issue TIMOB-4865: iOS: imageAsCropped rotates image
imageAsCropped seems to be rotating the image 90 degrees when applied. Before Crop: http://support-admin.appcelerator.com/files/cf1c121c-b9ae-11e0-8901-12313b1264a1/Before_crop.PNG After Crop: http://support-admin.appcelerator.com/files/cf110d22-b9ae-11e0-8901-12313b1264a1/After_crop.PNG Repro Code: {code:javascript} var win = Ti.UI.createWindow(); var currPic = null; var takePic = Ti.UI.createButton({ zIndex: 1000, width: "90%", height: 40, title: "Take picture" }); var imgView = null; takePic.addEventListener("click", function() { if (currPic !== null) { var croppedImg = currPic.imageAsCropped({ x: 0, y: 0, width: currPic.width, height: currPic.height }); imgView.image = croppedImg; } else { Ti.Media.requestCameraPermissions(takePhoto); } }); win.add(takePic); win.open(); function takePhoto(e) { if (!e.success) { Ti.API.error("No camera permissions granted"); return; } Ti.Media.showCamera({ success: function(event) { takePic.title = "Crop image"; var image = event.media; var width = image.width / 5; var height = image.height / 5; currPic = image; imgView = Ti.UI.createImageView({ zIndex: 0, width: width, height: height, image: image, top: 40 }); win.add(imgView) }, cancel: function() {}, error: function(error) {}, saveToPhotoGallery: false, mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO] }); } {code}
Story points: 5