openjpeg
openjpeg copied to clipboard
can not decompress a missing bytes .j2c file
please help me.
- using kadudu to compress 1 image , such as , kdu_compress -i image.jpg -o out.j2c Creversible=yes -rate 0.25 ;
- for some reasons , out.j2c may missing some bytes. so i delete a few bytes from bottom of in.j2c .
- kadudu can also decompress this image by cmd : kdu_expand -i in.j2c -o out.bmp .
- and opj_decompress kdu_expand -i in.j2c -o out.bmp will occur ERROR , like this
`
- .\opj_decompress.exe -i in.j2c -o out.bmp -W [C] JPWL correction capability activated; expecting 0 components; [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!`
Thanks.
@MastXu ,
it seems that you do not have the time to explain what you do or have done.
2. for some reasons , out.j2c may missing some bytes. so i delete a few bytes from bottom of in.j2c .
in.j2c XOR out.j2c ?
Nevertheless: if you chop off some bytes from a file this file is broken. Which KDU version did you use? winfried
sorry, i check gmail , find this mentioned. thank you for your question. Correct my description .
- firstly, compress. using kadudu to compress 1 image , such as , kdu_compress -i image.jpg -o out.j2c Creversible=yes -rate 0.25 ;
- then , i delete a few bytes of out.j2c from bottom to up .
- kadudu can also decompress this image by cmd : kdu_expand -i out.j2c -o out.bmp. and i can open and use the out.bmp normally;
- and opj_decompress -i out.j2c -o out.bmp will occur ERROR , like last description. `.\opj_decompress.exe -i in.j2c -o out.bmp -W [C] JPWL correction capability activated; expecting 0 components; [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!``
the kadudu version used is Kakadu_V2.2.3.
@MastXu , removing some bytes from a file means breaking the file. As you know: appending a virus at the end of the file changes the length of the file. So your input file is broken.
Your KDU version is very old. I use
kdu_expand -v
This is Kakadu's "kdu_expand" application.
Compiled against the Kakadu core system, version v7.6
Current core system version is v7.6
I suppose v7.6 likewise does reject your input file.
winfried
Thank you. I will test with KDU v7.6 .
OMG, I am so done with Kakadu! 8.0.4 Kakadu has an opposite problem! It has some garbage bytes after end of codestream!! After 0xFFD9 marker! Fixed in 8.0.5.
@MastXu Please attach out.j2c right here (you can rename to .jpeg). Please not that Kakadu 8.0.5 no longer writes garbage after marker 0xFFD9.