openjpeg icon indicating copy to clipboard operation
openjpeg copied to clipboard

"[ERROR] Tile part length size inconsistent with stream length" on some older .j2k files

Open John-Nagle opened this issue 3 years ago • 1 comments

I've found a few .j2k files which will not decode with OpenJPEG, but are successfully decoded by the Kakadu decoder. Error message is

"ERROR] Tile part length size inconsistent with stream length"

jpylyzer, the validator, reports these errors:

jpylyzer --format jp2 --verbose *.j2k

<isValid format="j2c">False</isValid>
<foundNextTilePartOrEOC>False</foundNextTilePartOrEOC>

So the files are not strictly standards compliant.

This may be related to the addition of the PHR ("Personal Health Record"?) feature, near line 4903 of j2k.c, "Patch to support new PHR data". That adds some code related to "m_sot.length" and may have made the decoder less tolerant of this error.

If the decoder could be made more forgiving in this area, it would be helpful. This problem comes up in the context of clients for certain virtual worlds. Thanks.

badjpegs.zip

John-Nagle avatar Jun 01 '21 05:06 John-Nagle

Duplicate of https://github.com/uclouvain/openjpeg/issues/1116 (actually it is not).

Or at least it also prints

[INFO] Start to read j2k main header (0); [INFO] Main header has been correctly decoded. [INFO] No decoded area parameters, set the decoded area to the whole image [ERROR] Tile part length size inconsistent with stream length ERROR -> opj_decompress: failed to decode image!``

ValZapod avatar May 11 '22 08:05 ValZapod