openjpeg icon indicating copy to clipboard operation
openjpeg copied to clipboard

OPENJPEG could not encode 1-BIT RGB IMAGE

Open xingchenli1996 opened this issue 2 years ago • 4 comments

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 avatar Jun 13 '23 10:06 xingchenli1996

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

xingchenli1996 avatar Jun 13 '23 12:06 xingchenli1996

@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

szukw000 avatar Jun 14 '23 16:06 szukw000

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 avatar Jun 16 '23 04:06 xingchenli1996

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

xingchenli1996 avatar Jun 16 '23 04:06 xingchenli1996