📸 A well documented, high-level Android interface that makes capturing pictures and videos easy, addressing all of the common issues and needs. Real-time filters, gestures, watermarks, frame processing, RAW, output of any size.
Device / Android version: Redmi Note 8 Pro, API 29
When switching to RAW Mode, we set mCaptureSize field using computeCaptureSize(), this one relies on the Set<Size> of supportedPictureSizes, picking the biggest, that's the problem: some manufacturer like in Redmi Note 8 Pro, returns as RAW_SENSOR sizes:
But 9280x6944 it's a lie, since the maximum sensor pixel array is 4640x3472px . So while for JPEG it's not crashing because they might use some kinda of interpolation to upsample, for RAW it will since the only capture size allowed is the one set in SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE ( or SENSOR_INFO_PIXEL_ARRAY_SIZE if the first is null )
Enclosed dump of Camera2 API in Redmi Note 8 Pro
camera2info-Redmi_Redmi_Note_8_Pro.txt
To Reproduce
Steps to reproduce the behavior, possibly in the demo app:
Go to Settings in demo app
Select Picture Format "dng"
Exception #2 , camera stop
java.lang.AssertionError: Height and width of image buffer did not match height and width of either the preCorrectionActiveArraySize or the pixelArraySize.
bug
When switching to RAW Mode, we set
mCaptureSize
field usingcomputeCaptureSize()
, this one relies on theSet<Size>
ofsupportedPictureSizes
, picking the biggest, that's the problem: some manufacturer like in Redmi Note 8 Pro, returns as RAW_SENSOR sizes:But 9280x6944 it's a lie, since the maximum sensor pixel array is 4640x3472px . So while for JPEG it's not crashing because they might use some kinda of interpolation to upsample, for RAW it will since the only capture size allowed is the one set in
SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
( orSENSOR_INFO_PIXEL_ARRAY_SIZE
if the first is null ) Enclosed dump of Camera2 API in Redmi Note 8 Pro camera2info-Redmi_Redmi_Note_8_Pro.txtTo Reproduce
Steps to reproduce the behavior, possibly in the demo app:
#2
, camera stopjava.lang.AssertionError: Height and width of image buffer did not match height and width of either the preCorrectionActiveArraySize or the pixelArraySize.
Expected behavior
Switch to dng mode and capture in raw