yasirkula/UnityNativeCamera

Selfie Camera image upside down

DevSpur opened this issue · 1 comments

When using the selfie camera after taking photo the image loads upside down, I need to upload this image to a server and it needs to be the right way up.

  • Unity version: 2022.3.22f1
  • Platform: iOS
  • Device: Iphone 14 pro max
  • How did you download the plugin: Package Manager.

Mobile cameras insert EXIF metadata into those images, stating how many degrees to rotate an image to display it properly. If an image viewer respects that EXIF metadata, the image will be displayed correctly. For example, I'd expect all mobile devices to display those images correctly. However, you may want to hardcode that rotation to the image to support all image viewers. One way to achieve this with NativeCamera is to call LoadImageAtPath to load the image into a Texture2D and then save it as PNG or JPEG via texture.EncodeToPNG/EncodeToJPG. The resulting image should have correct orientation.