I've been working on an old project with an outdated Zxing library version that needed to be updated to fix the reverse image bug on the Nexus 5x. I managed to update the library but only portrait mode should be supported.
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
source = activity.getCameraManager().buildLuminanceSource(data,
width, height);
} else {
byte[] rotatedData = new byte[data.length];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++)
rotatedData[x * height + height - y - 1] = data[x + y
* width];
}
int tmp = width;
width = height;
height = tmp;
data = rotatedData;
source = activity.getCameraManager().buildLuminanceSource(data,
width, height);
}
I'm now facing an issue decoding the barcode on our Nexus 5X device where our EAN-13 barcode seems to be rotated as you can see in the images below.
Nexus 5X
Android 6.0 device