Camerakit-android: OnePlus 3 creates image with corruption on one edge

Created on 15 Nov 2018  路  6Comments  路  Source: CameraKit/camerakit-android

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

OnePlus 3 running OxygenOS 5.0.6 (Android 8.0.0).

CameraKit beta 3.1 and 3.9 both have this problem, I haven't tested all the releases in-between.

Steps to Reproduce

Take a photo and save to storage. As far as I can tell other phones and the Android Emulator don't exhibit this issue.

I'm saving the image from camera.captureImage() directly to storage without any further processing.

Expected Behavior

An image without the corruption.

Actual Behavior

Photo taken in landscape. Notice the corruption on the right hand side of the photo:

photo8471558192562916001

Photo taken in portrait. Same corruption on the right hand side:

photo4932265917924728197

If I take the corrupted part, flip it, and move it over to the left, you can see it lines up with where it should be. I've left a white line to demonstrate the bit I've moved:

image

The same seems to be true for the second image,

Reproducible Demo

I can make one if needed, but I'm just calling camera.captureImage() and saving the image directly so it will likely be the same in your own demo app.

Thanks

Most helpful comment

I can confirm this bug on many other devices too. I don't think it is device specific.

All 6 comments

I can confirm this bug on many other devices too. I don't think it is device specific.

I also found root cause. The problem is caused by JpegKit.

There is following code in com.camerakit.CameraPreview#capturePhoto

val jpeg = Jpeg(it)
jpeg.rotate(captureOrientation)

jpeg.rotate busts the image. I'll also file bug in JpegKit project.

Ahh, good find. Hopefully if it occurs on multiple devices it'll be easier for someone with far more jpeg/NDK experience than myself to fix.

@akiller I'm currently digging into JpegKit and it seems to be bug either in JpegKit or directly in https://github.com/libjpeg-turbo/ (JpegKit is wrapper around jpeg-turbo library). I'll update this bug report with my findings.

@thubalek-inloop @akiller yeah, this is definitely a multiple device problem. @austinkettner @emersoncloud is this serious issue on the docket for v1.0.0-beta3.11? I'm seeing it in beta3.9 and beta3.10.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cabflip picture cabflip  路  3Comments

jewom picture jewom  路  6Comments

mhwu1103 picture mhwu1103  路  6Comments

MuhammedRefaat picture MuhammedRefaat  路  3Comments

ritesh94 picture ritesh94  路  6Comments