Skip to content

Commit

Permalink
Fixed Derivation Code Sequence creation.
Browse files Browse the repository at this point in the history
The dcmjpeg encoder does not anymore create a derivation code sequence
when lossless compression is performed.

Thanks to Markus Sabin <[email protected]> for the bug report
and patch.

This closes DCMTK issue #924.
  • Loading branch information
Marco Eichelberg committed Apr 7, 2020
1 parent 4fb86c2 commit 3a95927
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dcmjpeg/libsrc/djcodece.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (C) 2001-2019, OFFIS e.V.
* Copyright (C) 2001-2020, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
Expand Down Expand Up @@ -823,10 +823,9 @@ OFCondition DJCodecEncoder::updateDerivationDescription(
// assume we can cast the codec parameter to what we need
DJCodecParameter *djcp = OFconst_cast(DJCodecParameter*, cp);

if (djcp->getTrueLosslessMode())
result = DcmCodec::insertCodeSequence(dataset, DCM_DerivationCodeSequence, "DCM", "121327", "Full fidelity image");
else // pseudo-lossless mode may also result in lossy compression
if (!isLosslessProcess() || !djcp->getTrueLosslessMode())
result = DcmCodec::insertCodeSequence(dataset, DCM_DerivationCodeSequence, "DCM", "113040", "Lossy Compression");

}
return result;
}
Expand Down

0 comments on commit 3a95927

Please sign in to comment.