Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPENJPEG could not encode 1-BIT RGB IMAGE #1469

Open
xingchenli1996 opened this issue Jun 13, 2023 · 4 comments
Open

OPENJPEG could not encode 1-BIT RGB IMAGE #1469

xingchenli1996 opened this issue Jun 13, 2023 · 4 comments

Comments

@xingchenli1996
Copy link

Expected behavior and actual behavior.

I try to encode a 1-BIT RGB IMAGE. INPUT IMAGE is a 16BIT-IMAGE which only contains 0 and 65535 in each color channel. But the "opj-compress" module throws the following error everytime.

[INFO] tile number 1 / 1
[ERROR] opj_t2_encode_packet(): only 482 bytes remaining in output buffer. 727 needed.
[ERROR] Cannot encode tile
failed to encode image: opj_encode
failed to encode image: opj_end_compress
failed to encode image

Steps to reproduce the problem.

OPENJPEG ENCODE

Operating system

MAC OS 12.0

openjpeg version

2.5.0

@xingchenli1996
Copy link
Author

xingchenli1996 commented Jun 13, 2023

TF3_17BIT_000000003170_复杂压缩非倒置
HERE is the original file which uses 16-BIT to store a DOUBLE-VALUE RGB data only containing 0 and 65535

@szukw000
Copy link
Contributor

@xinglenchi1996,

This file is broken: 245480784-66a9495d-8310-46cb-bd2f-379c308e75bb.png

LINUX:
    pngcheck 1536x864 48 Bit RGB, non-interlaced 92.2%
    krita the same wrong image
    firefox the same wrong image 
    kdu-expand code stream must start with an SOC marker

WIN10
    irfanview64 Kdu Core Error: code stream must start with an SOC marker

winfried

@xingchenli1996
Copy link
Author

TF3_17BIT_000000003168_复杂压缩非倒置.TIF.zip

@xinglenchi1996,

This file is broken: 245480784-66a9495d-8310-46cb-bd2f-379c308e75bb.png

LINUX:
    pngcheck 1536x864 48 Bit RGB, non-interlaced 92.2%
    krita the same wrong image
    firefox the same wrong image 
    kdu-expand code stream must start with an SOC marker

WIN10
    irfanview64 Kdu Core Error: code stream must start with an SOC marker

winfried

HERE is the ORIGINAL FILE. And the file ABOVE is only for PREVIEWING

@xingchenli1996
Copy link
Author

ORIGINAL COMMAND is like this:

"/Users/lixingchen/Downloads/openjpeg-v2.5.0-osx-x86_64/bin/opj_compress" -threads 1 -r 1 -n 7 -TargetBitDepth 1 -i "/Volumes/A028/MAT/37-89-1/NEW/PART-1/METHOD-03/CORE/INTEGER17_TO_32/TF3_17BIT_000000003168_复杂压缩非倒置.TIF" -o "/Volumes/A028/MAT/37-89-1/NEW/PART-1/METHOD-03/CORE/INTEGER17_TO_32/TF3_17BIT_000000003168_复杂压缩非倒置.JP2"

[INFO] tile number 1 / 1
[ERROR] opj_t2_encode_packet(): only 445 bytes remaining in output buffer. 895 needed.
[ERROR] Cannot encode tile
failed to encode image: opj_encode
failed to encode image: opj_end_compress
failed to encode image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants