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.
[~morahman] I am assuming you tried to reproduce this? Is this a regression? Does older SDK face the same problem?
HI All, Is there any progress on this
Hi All, Is there any progress...
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
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
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