1

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?

airowe
  • 794
  • 2
  • 9
  • 29
  • Did you ever figure this out? Seems like I'll have to get bitmap from my URI and rotate that before re-getting URI. Did you end up doing this / can you show me what you did? – rafvasq Aug 28 '16 at 02:03
  • @ImagineThat I ended up having to get the bitmap, from the URI, rotate it and re-save it unfortunately. Didn't see any other way around it. – airowe Aug 29 '16 at 13:38

0 Answers0