Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7511] iOS: Camera component is only providing low resolution pictures (when allowing edit)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-02-14T23:29:04.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0
Fix Version/sSprint 2012-03, Release 2.0.0, Release 1.8.2
ComponentsiOS
Labelsparity
ReporterMauro Parra-Miranda
AssigneeVishal Duggal
Created2012-02-01T18:02:09.000+0000
Updated2012-03-04T21:35:35.000+0000

Description

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

Comments

  1. Vishal Duggal 2012-02-02

    Pull pending #1334
  2. Wilson Luu 2012-02-07

    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)

JSON Source