camerakit-android
camerakit-android copied to clipboard
Picture captured from front cam is showing a thin layer of back cam view at right corner
In Note 5 when i capture picture from front cam then it shows a thin layer of back camera view on right corner of image.
Same issue in HUAWEI P20.
Same on a Sony Xperia, I thought it was just a pale line, but no it is clearly a little bit of an image. I make it 8 pixels wide on a 1080x1920 image.
Same issue in HUAWEI HONOR
Hi all, In my case, I realized this issue caused by turbo-jpeg. If the image's width or height is not evenly divisible by the MCU block size (which is 16 here), the cropping result will create odd-looking strips on the right or bottom edge of the image.
I fix it by adding TJXOPT_TRIM
option to discard the partial MCU blocks.
Hope this helps.
diff --git a/camerakit/src/main/cpp/JniJpegTransformer.cpp b/camerakit/src/main/cpp/JniJpegTransformer.cpp
index 9da50aa..1c73283 100644
--- a/camerakit/src/main/cpp/JniJpegTransformer.cpp
+++ b/camerakit/src/main/cpp/JniJpegTransformer.cpp
@@ -148,7 +148,7 @@ Java_com_wonderkiln_camerakit_JpegTransformer_jniCommit
cropRegion.h = jpegTransformer->cropHeight;
transform->r = cropRegion;
- transform->options = TJXOPT_CROP;
+ transform->options = TJXOPT_CROP | TJXOPT_TRIM;
}
@chiel99 this solution didn't work for me
Also having this same issue on Samsung S5, S7, S9+. Basically anything ive tested on. How can we crop this?