domax / cordova-plugin-photos

This Cordova/Phonegap plugin provides access to photo library on device.
MIT License
20 stars 13 forks source link

Some images are fetched in wrong orientation #7

Open domax opened 7 years ago

domax commented 7 years ago

iOS version should take into account imageOrientation property for correct image orientation.

victoria168 commented 7 years ago

Hi, any updates on this issue? Some of my images are fetched in wrong direction too.

domax commented 7 years ago

@victoria168 : Unfortunately I've lost all my images with wrong orientation :(. I would be very grateful for steps how to make such photos.

victoria168 commented 7 years ago

@domax Do you mean how to repeat the step of displaying wrong direction? My step is: call photo() to get all meta data of photos -> call thumbnail() and display in small grid (orientation ok) -> call image() to get raw photo and display it (pictures taken by camera are displayed in wrong orientation). I'm using iPhong6 IOS 10.3.3 for testing.

domax commented 7 years ago

@victoria168 No )) - I know how to get existing images from device (since it's me who wrote this plugin). I mean steps how to take (shoot) photos in a way that they will have wrong orientation. I had such photos in my iPhone - I just discovered that they are fetched from device in wrong orientation. But I have no idea why they have it wrong, and how it was happen. I've lost all such photos, so I have to make them again to fix this issue.

victoria168 commented 6 years ago

Hi, do you encounter this issue in Android? I find in Android album a property called 'Orientation'. Without it all images get from Photos.photos() are in wrong orientation. Is it possible to add this property to your plugin? Thanks. Android version: 6.0.1

domax commented 6 years ago

@victoria168 : sure it's possible. Though, I never observed the wrong orientations on my Android devices yet. I have no device with 6th Android - I'll try to reproduce it in emulator, but I cannot provide any estimations for now, unfortunately.

victoria168 commented 6 years ago

@domax thanks so much. Have you added orientation params yet? Please let me know so that I can test in my Android v6 device.

bea545lisa commented 6 years ago

@domax on Android image orientation is yet not included and some photos therefore have wrong orientation. Isn't it possible to add orientation parameter? Thanks.

loshonja commented 5 years ago

Hi, this issue still persists on Android. Here is my conclusion why this problem appears and my solution.

Some Camera apps store captured images with the original orientation (as they were taken). Plugin is fine with it.

Camera apps on some Android devices store images always in landscape (orientation 0), but with appropriate orientation info stored as additional exif metadata. Plugin currently is not taking that information in consideration and always returns landscape images as both thumbnails and images.

Firstly, I decided to find another plugin that handles this problem, but encountered a lot of different problems with them so after few days I found that the best solution is to use this plugin with few changes I made within in:

domax commented 5 years ago

@loshonja - please send pull request with your fix, if you don't mind. Thank you in advance