I'm trying to upload a captured photo to a WebView in Android after triggering the onShowFileChooser method of Android's WebChromeClient.
Everything works fine, except all images taken in portrait mode are rotated to landscape.
In onActivityResult, I can create a URI that represents the captured image's file location, which is then passed to ValueCallback.onReceiveValue(T value). However, I can't manipulate the image itself and change the ExifInterface Orientation tag to rotate the image back to portrait.
I could create a bitmap from the URI, rotate, then re-save that bitmap getting a new URI to pass back to the Webview. But that seems terribly expensive and non-performant. Any other suggestions before I go down that route?