Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #1239 , Redmi RAW crash #1240

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michelerenzullo
Copy link

@michelerenzullo michelerenzullo commented Jun 19, 2023

bug

  • CameraView version: 2.7.2
  • Camera engine used: Camera2
  • Reproducible in official demo app: YES
  • 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:

RAW_SENSOR sizes: 
[4640x3472@(33.333, 33.3), 9280x6944@(50.000, 33.3)]

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:

  1. Go to Settings in demo app
  2. Select Picture Format "dng"
  3. 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.

Expected behavior

Switch to dng mode and capture in raw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants