Problem description
The camera provides the option to move and scale, producing images with low quality by default (640x640).
Expected behavior
The camera should be able to store a high quality image if needed (when editing).
Actual behavior
The picture from the camera will be in low quality by default.
Test case
var win = Titanium.UI.createWindow();
Titanium.Media.showCamera({
success:function(event)
{
var cropRect = event.cropRect;
var image = event.media;
Ti.API.debug('Our type was: '+event.mediaType);
if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)
{
var imageView = Ti.UI.createImageView({
width:win.width,
height:win.height,
image:event.media
});
win.add(imageView);
}
else
{
alert("got the wrong type back ="+event.mediaType);
}
},
cancel:function()
{
},
error:function(error)
{
// create alert
var a = Titanium.UI.createAlertDialog({title:'Camera'});
// set message
if (error.code == Titanium.Media.NO_CAMERA)
{
a.setMessage('Please run this test on device');
}
else
{
a.setMessage('Unexpected error: ' + error.code);
}
// show alert
a.show();
},
saveToPhotoGallery:true,
allowEditing:true,
mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]
});
win.open();
Community Discusion
http://developer.appcelerator.com/question/131329/low-quality-images-with-showcamera
Pull pending #1334
Closing bug. Verified fix on: SDK build: 1.9.0.v20120207000134 Titanium Studio, build: 1.0.8.201201262211 xcode: 4.2 Devices: iPhone 4S Sprint (5.0.1)