I'm trying to read an image from an ImageReader set to a particular resolution (obtained from CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP
of course), but the ImageReader.acquireLastestImage
returns an image of a different resolution!
Note: This only happens (so far as I've seen) on Samsung Galaxy S6 with the preview resolution set to 800x450, and the output resolution on the Image is apparently 640x480. Other resolutions seem fine, as well as other phones.
Relevant code:
Image im = mReader.acquireLatestImage();
Log.v(TAG, String.format("Image size %d x %d", im.getWidth(), im.getHeight()));
Log.v(TAG, String.format("ImageReader size %d x %d", mReader.getWidth(), mReader.getHeight()));
The output log:
01-30 15:43:46.350 31422-31954/com.myapp V/ImageProcessor: Image size 640 x 480
01-30 15:43:46.350 31422-31954/com.myapp V/ImageProcessor: ImageReader size 800 x 450
What could be wrong? A bug in Android? A bug in the Galaxy S6 implementation?
Is it not guaranteed that the camera will abide by the request of the ImageReader surface?