0

I am using the android CWAC lib as part of the camera implementation within my app. It is working really well, however I discovered an issue with the image preview.

Whenever I capture an image, I display it full screen within the same fragment, it works correctly. However if I pause the app by pressing the home button or visiting another section of the app and coming back to my camera screen, the image captured by the camera is incorrectly rotated.

The camera works really well for me in most cases and the image quality too is really good. However I cannot seem to figure out why simply pausing and resuming the app(my implementation of the CameraFragment) is causing the image captured and displayed to be incorrectly rotated.

P.S - My activity is set to work in portrait only. This does not happen with the demo app, however in the demo app the image captured is shown in a separate activity.

Rohan
  • 593
  • 7
  • 22
  • Since this library has been replaced, I have no means of helping you. – CommonsWare Oct 12 '15 at 10:34
  • Alright. Any ideas or guesses as to where I might be messing up, Mark? – Rohan Oct 12 '15 at 10:38
  • It is unclear to me if "image captured by the camera is incorrectly rotated" refers to actual image capture or the preview. If it is actual image capture, you are running out of memory. The logic to rotate the image based on the EXIF `Orientation` header is memory-intensive, particularly for larger photos. – CommonsWare Oct 12 '15 at 10:44
  • I am using the Glide library to set the byteArray that I get from the saveImage method on the imageview. Also, this rotation only happens if the app itself gets paused for whatever reason, like the screen going off or me intentionally pressing the home button and returning to the app. If i am engaging with the app and taking my pics sequentially, like I need to in portrait mode, the orientation of the images is correct. This is why I find it weird(?) and I do not think it is related to a memory issue. – Rohan Oct 12 '15 at 10:49
  • 1
    I can offer no other explanation for why `ImageCleanupTask` isn't doing its job. In the replacement library, when I add in this image-normalization logic, I will be using NDK code for the memory-intensive bits, which hopefully will eliminate this sort of problem. – CommonsWare Oct 12 '15 at 11:45

0 Answers0