Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23916] iOS: After taking picture from landscape mode showing white color on top and bottom portion.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-03-01T14:15:07.000+0000
Affected Version/sRelease 5.5.0
Fix Version/sRelease 6.1.0
ComponentsiOS
Labelsn/a
ReporterMotiur Rahman
AssigneeVijay Singh
Created2016-09-17T15:50:09.000+0000
Updated2017-03-08T13:23:51.000+0000

Description

description

If I take a picture in the landscape, the result saved image show white color(top and bottom).

Steps to Reproduce

1. Just run the following code on the device. 2. Take a picture in landscape mode. 3. Now see the image from the device gallery, show white color(top and bottom). This is the issue.

Test case

var win = Titanium.UI.createWindow({
	title : 'Tab 1',
	backgroundColor : '#fff'
});

var camera = Ti.UI.createButton({
	title : 'Open Camera',
	height : 50,
	width : 100,
	top : 50,
	left : 50
});

win.add(camera);

function openCamera() {
	if (Ti.Media.isCameraSupported) {
		//Ti.Media.setCameraFlashMode(Ti.Media.CAMERA_FLASH_ON);
		//Ti.Media.setCameraFlashMode(1);
		//alert(Ti.Media.getCameraFlashMode());
		//check if this return 0 always

		Titanium.Media.showCamera({
			success : function(event) {
				Ti.API.info('success caprured image saveToPhotoGallery');
				Ti.Media.hideCamera();

			},
			cancel : function() {
				// called when user cancels taking a picture
			},
			error : function(error) {
				// called when there's an error
				var a = Titanium.UI.createAlertDialog({
					title : 'Camera'
				});
				if (error.code == Titanium.Media.NO_CAMERA) {
					a.setMessage('Please run this test on device');
				} else {
					a.setMessage('Unexpected error: ' + error.code);
				}
				a.show();
			},
			saveToPhotoGallery : true,
			//overlay : overlay,
			allowEditing : true,
			mediaTypes : [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO],
			showControls : true // always use to get the basic facility about camera.
			//overlay:overlayview // do not use overlay to when you want to use the switching facility
		});

	}
}

camera.addEventListener('click', function() {
	openCamera();
});

win.add(camera);
win.open();

Actual: If I take a picture in landscape, the result will be a portrait So some top of portion is showing white color. Expected: If I take a picture in landscape, the result captured image should not show white color.

Comments

  1. Chee Kiat Ng 2016-09-21

    [~morahman] I am assuming you tried to reproduce this? Is this a regression? Does older SDK face the same problem?
  2. chanakya 2016-10-18

    HI All, Is there any progress on this
  3. chanakya 2016-12-12

    Hi All, Is there any progress...
  4. Mostafizur Rahman 2016-12-14

    Hello, We have tested this issue on following SDKs but got same result.After taking picture from landscape mode showing white color on top and bottom portion. *Testing environment:* SDK: *6.0.0.GA, 5.5.1.GA,5.5.0.GA, 5.4.0.GA, 5.3.1.GA* Appcelerator Command-Line Interface, version 6.0.0 Thanks
  5. Vijay Singh 2017-02-01

    If allowEditing is true, whatever is inside the cropping rectangle get captured and that get saved. If we capture any image in landscape mode, in cropping rectangle it will be with a black strip at top followed by actual image. If we do not adjust image , the whole part inside the cropping rectangle get captured. So image saved in gallery will have black strip. This is native behavior. In our sdk rather black strip it was giving white. In following PR it is aligned to native behavior. PR : https://github.com/appcelerator/titanium_mobile/pull/8810
  6. Harry Bryant 2017-03-01

    Verified as fixed, when taking pictures in landscape, white borders are no longer present around the saved image. Tested On: iPhone 7 10.2 Device Mac OS Sierra (10.12.2) Ti SDK: 6.1.0 Appc Studio: 4.8.1.201701192045 Appc NPM: 4.2.9-1 App CLI: 6.1.0 Xcode 8.2.1 Node v4.4.7

JSON Source