Skip to content

Commit

Permalink
Fixed padding of compressed JPEG-LS bitstream.
Browse files Browse the repository at this point in the history
When using the cooked JPEG-LS encoder, odd-length bitstreams were padded with
a trailing zero byte (corresponding to the --padding-zero command line option)
instead of a an extended EOI marker.

Thanks to Mathieu Malaterre <[email protected]> for the bug report and pull request.

This closes Github pull request #111.
  • Loading branch information
eichelberg committed Dec 17, 2024
1 parent bb650eb commit 7696450
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dcmjpls/libsrc/djcodece.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ OFCondition DJLSEncoderBase::compressCookedFrame(
{
// 'compressed_buffer_size' now contains the size of the compressed data in buffer
compressedSize = OFstatic_cast(unsigned long, bytesWritten);
fixPaddingIfNecessary(OFstatic_cast(Uint8 *, buffer), compressed_buffer_size, compressedSize, djcp->getUseFFbitstreamPadding());
fixPaddingIfNecessary(OFstatic_cast(Uint8 *, compressed_buffer), compressed_buffer_size, compressedSize, djcp->getUseFFbitstreamPadding());
result = pixelSequence->storeCompressedFrame(offsetList, compressed_buffer, compressedSize, fragmentSize);
}

Expand Down

0 comments on commit 7696450

Please sign in to comment.