这是indexloc提供的服务,不要输入任何密码
Skip to content

JPEG Bitstream Reconstruction (JxlEncoderAddJPEGFrame) Failing for Some Images  #2693

@John-P

Description

@John-P

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
TCGA-S3-A6ZH-01Z-00-DX1@JPEG-Tile-Index-0
TCGA-S3-A6ZH-01Z-00-DX1@JPEG-Tile-Index-1874
TCGA-S3-A6ZH-01Z-00-DX1@JPEG-Tile-Index-1875
Original 446 MB TIFF file at https://portal.gdc.cancer.gov/files/ce717a46-a25a-42f3-8402-10239838d0c6

Failing JPEGS
TCGA-AN-A046-01Z-00-DX1@JPEG-Tile-Index-0
TCGA-AN-A046-01Z-00-DX1@JPEG-Tile-Index-2430
TCGA-AN-A046-01Z-00-DX1@JPEG-Tile-Index-2930
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:

  1. JxlEncoderCreate
  2. JxlEncoderFrameSettingsCreate
  3. JxlEncoderStoreJPEGMetadata
  4. JxlEncoderAddJPEGFrame <- error here, then calling JxlEncoderGetError
  5. JxlEncoderProcessOutput (until no more output)
  6. JxlEncoderDestroy

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to the libjxl APIdocumentationImprovements or additions to documentationencoderRelated to the libjxl encoderunrelated to 1.0Things that need not be done before the 1.0 version milestone

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions