-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Describe the bug
I am experimenting with the lossless conversion of some JPEG files (extracted from large tiled TIFF files). Some of these images convert without an issue, but others have an error (JxlEncoderError JXL_ENC_ERR_JBRD) when JxlEncoderAddJPEGFrame is called with no further information.
To Reproduce
Set up an encoder and add a JPEG frame (see additional context).
I have included some tiles extracted from the TIFFs that successfully convert and some that do not. I also link to the original TIFF files as they are quite large. I hope that GitHub does not alter the files 🤞.
Passing JPEGs
Original 446 MB TIFF file at https://portal.gdc.cancer.gov/files/ce717a46-a25a-42f3-8402-10239838d0c6
Failing JPEGS
Original 422 MB TIFF file at https://portal.gdc.cancer.gov/files/5a69a438-d7b2-40fa-afc1-0d02de55ee02
Expected behavior
Lossless conversion of both sets of JPEG files is expected to occur without error.
Environment
- OS: macOS 13.4.1 (c)
- Compiler version: n/a
- CPU type: Apple M1
- cjxl/djxl version string: 0.8.2 (via conda-forge)
Additional context
I am converting the images using a simple Python ctype script which calls:
- JxlEncoderCreate
- JxlEncoderFrameSettingsCreate
- JxlEncoderStoreJPEGMetadata
- JxlEncoderAddJPEGFrame <- error here, then calling JxlEncoderGetError
- JxlEncoderProcessOutput (until no more output)
- JxlEncoderDestroy