Writing jp2 images with 8 bit signed data fails (incorrect data is written) on 32 bit Arm platforms. This is because OPJ_CHAR is defined to be 'char' and assumed to be signed, but on 32 bit Arm, 'char' is unsigned, not signed. This leads to incorrect values being stored in the jp2.
The attached patch fixes the issue by using OPJ_INT8 instead of OPJ_CHAR where it matters. It would also be possible to define OPJ_CHAR to be 'signed char' explicitly, but that could cause problems with string functions.
0001-Use-OPJ_INT8-instead-of-OPJ_CHAR-when-a-signed-type-.patch