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

Encoding failure for 1-bit images with opj_compress #1522

Open
scaramallion opened this issue Mar 17, 2024 · 0 comments
Open

Encoding failure for 1-bit images with opj_compress #1522

scaramallion opened this issue Mar 17, 2024 · 0 comments

Comments

@scaramallion
Copy link
Contributor

Expected behavior and actual behavior.

1-bit images should encode correctly, however instead I'm getting the following, with variations on the remaining/needed:

[INFO] tile number 1 / 1
[ERROR] opj_t2_encode_packet(): only 203 bytes remaining in output buffer. 755 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.

Run opj_compress -i 1bit_failure.raw -o 1bit.j2k -F 123,234,1,1,u

Other things I've noticed:

  • A smaller image works OK with opj_compress -i 1bit_success.raw -o 1bit.j2k -F 70,100,1,1,u
  • opj_compress -i 1bit_failure.raw -o 1bit.j2k -F 123,234,1,2,u (i.e. 2-bit precision) also works OK

Test files (rename extensions to raw) - these are just purely random 1-bit images:

Operating system

Ubuntu 22.04

openjpeg version

Current master, also 2.5.0.

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

1 participant