Skip to content

Fix padding skipping in multiframe JPEG decoding#414

Merged
Enet4 merged 4 commits intomasterfrom
bug/413
Sep 4, 2023
Merged

Fix padding skipping in multiframe JPEG decoding#414
Enet4 merged 4 commits intomasterfrom
bug/413

Conversation

@Enet4
Copy link
Copy Markdown
Owner

@Enet4 Enet4 commented Sep 2, 2023

Resolves #413, so that it can decode JPEG baseline with odd length fragments.

An alternative to trying to patch the decode implementation is to remove it entirely and let the trait's default implementation and decode_frame take its place.

@Enet4 Enet4 added bug This is a bug A-lib Area: library C-pixeldata Crate: dicom-pixeldata jpeg Support for the JPEG family of transfer syntaxes C-transfer-syntax Crate: dicom-transfer-syntax-registry and removed C-pixeldata Crate: dicom-pixeldata labels Sep 2, 2023
@Enet4 Enet4 changed the title [ts-registry] Fix padding skipping in multiframe JPEG decoding Fix padding skipping in multiframe JPEG decoding Sep 2, 2023
- do not throw error on missing Number of Frames,
  interpret instead as having a single frame
- change end of frames check to next even
- bail out earlier if there are very few bytes left
- add frame number being decoded on error
- adjust comments, leave notes
- extend frame data retrieval logic
  to consider frames spanning multiple fragments
- include equivalent end-of-file and SOI marker checks
  from JpegAdapter::decode
@Enet4 Enet4 marked this pull request as ready for review September 3, 2023 09:55
@Enet4
Copy link
Copy Markdown
Owner Author

Enet4 commented Sep 3, 2023

Indeed I found issues in JpegAdapter, both trough the complete decode method and the per-frame method decode_frame. I believe that they have been fixed, and turning RUBO's 0003.dcm into images should work now.

@Enet4 Enet4 merged commit 6863f18 into master Sep 4, 2023
@Enet4 Enet4 mentioned this pull request Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library bug This is a bug C-transfer-syntax Crate: dicom-transfer-syntax-registry jpeg Support for the JPEG family of transfer syntaxes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First two bytes are not an SOI marker error

1 participant