Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23716] Windows: Front camera preview/image is upside down

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-08-04T18:41:31.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 6.0.0
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2016-08-03T09:09:36.000+0000
Updated2016-08-31T07:59:27.000+0000

Description

As of TIMOB-23687 we can take a shot from front camera, but its preview and saved image is upside down.
var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }),
    openButton = Ti.UI.createButton({ title: 'OPEN CAMERA', backgroundColor: 'blue' }),
    imageView = Ti.UI.createImageView({ width: Ti.UI.FILL, height: '70%' });

var overlay = Ti.UI.createView({
    layout: 'vertical',
    height: '20%', width: Ti.UI.FILL,
    bottom: 0
}),
takeButton = Ti.UI.createButton({ title: 'TAKE A PHOTO', backgroundColor: 'red' }),
hideButton = Ti.UI.createButton({ title: 'HIDE PREVIEW', backgroundColor: 'red' });

takeButton.addEventListener('click', function () {
    Ti.Media.takePicture();
});
hideButton.addEventListener('click', function () {
    Ti.Media.hideCamera();
});
overlay.add(takeButton);
overlay.add(hideButton);

openButton.addEventListener('click', function () {
    Ti.Media.showCamera({
        whichCamera: Titanium.Media.CAMERA_FRONT, // Titanium.Media.CAMERA_REAR
        mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
        overlay: overlay,
        success: function (e) {
            Ti.API.info('showCamera() success');
            imageView.image = e.media;
        },
        error: function (e) {
            alert('showCamera() error: ' + JSON.stringify(e));
        }
    });
});

win.add(openButton);
win.add(imageView);
win.open();

Comments

  1. Kota Iguchi 2016-08-04

    https://github.com/appcelerator/titanium_mobile_windows/pull/802
  2. Ewan Harris 2016-08-31

    Verified using: Windows 10 Pro Appc core: 6.0.0-35 Appc NPM: 4.2.8-6 Ti SDK: 6.0.0.v20160829234637 Lumia 930 10.0 Front camera preview is now oriented correctly Closing ticket

JSON Source