简体   繁体   中英

Photos with wrong orientation

i'm trying the Sencha Touch Camera API( http://docs.sencha.com/touch/2.3.1/#!/api/Ext.device.Camera ) for taking pictures in a mobile device. Following the documentation instructions, now i'm able to capture the image in a base64 format, what is great. However, when the photo is taken in portrait orientation, it comes rotated by 90 degrees. This doesn't happen when the photo is taken in landscape orientation.

I suppose i can deal with this just by rotating the image. However, first i need to know what orientation was used.

What is the best way for doing this in Sencha Touch? I read that i could get the EXIF information using this , but looks like i can't access EXIF class.

You could modify Ext.device.camera.Cordova passing in the correctOrientation property.

if ('correctOrientation' in args) {
    options.correctOrientation = args.correctOrientation;
}

Then you can pass the correctOrientation property directly to the capture() method.

It would be nice not to modify Sencha Touch sources, to prevent losing customizations when upgrading, so I would suggest you to extend the Ext.device.Camera singleton to use your Ext.device.camera.Custom .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM