You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to v2024.6.1, I'm sometimes encountering a decoding failure of JPEG2000 with imagecodecs._jpeg2k.Jpeg2kError: opj_decode or opj_end_decompress failed.
As it fails only in a long script and I'm using imagecodecs from zarr, it is difficult to share a reproducible example. (I pickled the input, but it didn't fail in a minimal example.) However, I found that it is outputting some warnings which were not seen in v2024.1.1. Do you think that it is the cause of the failure?
0
encoding
JPEG2K info: tile number 1 / 1
decoding
JPEG2K info: Start to read j2k main header (85).
JPEG2K info: Main header has been correctly decoded.
JPEG2K info: Header of tile 1 / 1 has been read.
JPEG2K info: Stream reached its end !
mean 1.0
1
encoding
JPEG2K info: tile number 1 / 1
decoding
JPEG2K info: Start to read j2k main header (85).
JPEG2K info: Main header has been correctly decoded.
JPEG2K info: Header of tile 1 / 1 has been read.
JPEG2K info: Stream reached its end !
JPEG2K warning: Problem with skipping JPEG2000 box, stream error
mean 1.0
2
encoding
JPEG2K info: tile number 1 / 1
decoding
JPEG2K info: Start to read j2k main header (85).
JPEG2K info: Main header has been correctly decoded.
JPEG2K info: Header of tile 1 / 1 has been read.
JPEG2K info: Stream reached its end !
JPEG2K warning: Problem with skipping JPEG2000 box, stream error
mean 1.0
With v2024.1.1
0
encoding
JPEG2K info: tile number 1 / 1
decoding
JPEG2K info: Start to read j2k main header (85).
JPEG2K info: Main header has been correctly decoded.
JPEG2K info: Header of tile 1 / 1 has been read.
JPEG2K info: Stream reached its end !
mean 1.0
1
encoding
JPEG2K info: tile number 1 / 1
decoding
JPEG2K info: Start to read j2k main header (85).
JPEG2K info: Main header has been correctly decoded.
JPEG2K info: Header of tile 1 / 1 has been read.
JPEG2K info: Stream reached its end !
mean 1.0
2
encoding
JPEG2K info: tile number 1 / 1
decoding
JPEG2K info: Start to read j2k main header (85).
JPEG2K info: Main header has been correctly decoded.
JPEG2K info: Header of tile 1 / 1 has been read.
JPEG2K info: Stream reached its end !
mean 1.0
Thanks for reporting the issue. I can reproduce the warnings and traced them to the latest changes in the encoder of _jpeg2k.pyx, not due to any OpenJPEG changes.
Ouch. Turns out the encoded buffer is not cropped correctly in some cases and trailed with uninitialized memory, which sometimes interferes with decoding. Not sure how the tests could pass on several platforms...
After upgrading to
v2024.6.1
, I'm sometimes encountering a decoding failure of JPEG2000 withimagecodecs._jpeg2k.Jpeg2kError: opj_decode or opj_end_decompress failed
.As it fails only in a long script and I'm using
imagecodecs
fromzarr
, it is difficult to share a reproducible example. (I pickled the input, but it didn't fail in a minimal example.) However, I found that it is outputting some warnings which were not seen inv2024.1.1
. Do you think that it is the cause of the failure?This is the snippet for reproducing the warnings.
With v2024.6.1
With v2024.1.1
Environment
Anyway, thank you for maintaining a fantastic package!
The text was updated successfully, but these errors were encountered: