Fotoapparat icon indicating copy to clipboard operation
Fotoapparat copied to clipboard

Resulting bitmap is null on API 17

Open arsenii-repository opened this issue 5 years ago • 0 comments

What are you trying to achieve or the steps to reproduce?

I want to take a photo from camera and show it in ImageView.

How did you initialize FA?

        Fotoapparat
                .with(this)
                .into(cameraView)
                .previewScaleType(ScaleType.CenterCrop)
                .lensPosition(back())
                .logger(loggers(
                        logcat()
                ))
                .cameraErrorCallback(e -> {
                    Log.e(TAG, e.toString());
                })
                .build();

What was the result you received?

In whenDone callback bitmap is null.

PhotoResult photoResult = fotoapparat.takePicture();
photoResult
    .toBitmap(scaled(0.25f))
    .whenDone(bitmapPhoto -> {
        if (bitmapPhoto == null) {
            Log.e(TAG, "Couldn't capture photo. Bitmap is null.");
        }
    });

What did you expect?

Bitmap isn't null.

Context:

  • FA version: 2.7.0, 2.6.1
  • Devices/APIs affected: API 17 (Real device)
  • any other relevant information: On Android Studio Emulator API 17 taking picture works, bitmap isn't null. Previously I used this library (https://github.com/fabian7593/MagicalCamera) and it works well on API 17, but has many crashes on API 25-27.

How can I solve this?

Thanks in advance.

arsenii-repository avatar Apr 18 '19 11:04 arsenii-repository