Lamelynx / GodotGetImagePlugin-Android

Godot plugin to select image from gallery or camera on Android device.
MIT License
71 stars 4 forks source link

Problems with camera orientation #8

Closed Pedro-Daniel closed 2 years ago

Pedro-Daniel commented 3 years ago

Debugging in Godot version 3.3. The same issue happened in Android and Xiaomi devices. The app camera does not understand the device sensor orientation, consequently, portrait images appears sideways on the screen, landscape images can be upright or upside down. I know nothing about XML and stuff, but the simpliest solution would be to make a viewport in godot, and create a new image with it, the image rotation would be set by the device orientation sensor. I think it could get similar to what WhatsApp does.

blurrred commented 2 years ago

I've also had this issue and I think it stems for Godot not recognizing rotational metadata when importing external images. Personally, I think the issue really stems from hiding image's rotation in metadata, rather than just replacing the image with a rotated one.

Lamelynx commented 2 years ago

I have looked in to this a while ago. The issue is with some devices have different camera rotation as default. It's also the issue if you take your photo in landscape or portrait mode. There are some solutions we could implement into the plugin that may fix the issue for most of the devices but not 100%.

Lamelynx commented 2 years ago

I have made a fix to get correct orientation on camera image. Only tested on a Samsung phone tough. See v0.1.5