Skip to content

Commit

Permalink
fix: Color conversion is required for RGB and planar configuration 1 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wayfarer3130 authored Sep 5, 2024
1 parent 7966717 commit 3bafe59
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function isColorConversionRequired(imageFrame) {
if (imageFrame === undefined) {
return false;
}
const { rows, columns, photometricInterpretation, pixelDataLength } =
const { rows, columns, photometricInterpretation, pixelDataLength, planarConfiguration } =
imageFrame;

// if it is rgba don't convert (typically jpeg, jpeg-xl, jpeg2000 etc)
Expand All @@ -34,7 +34,7 @@ export default function isColorConversionRequired(imageFrame) {
Math.floor(rows / 2) * columns
);
} else {
return photometricInterpretation !== 'RGB';
return photometricInterpretation !== 'RGB' || planarConfiguration===1;
// and it is one of the rle and lei cases then we need to convert
}
}

0 comments on commit 3bafe59

Please sign in to comment.