Skip to content

Commit b5b0588

Browse files
committed
Fixed issue with wrong photometric interpretation tag value from jpeg compressed files
1 parent 4ed5311 commit b5b0588

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/FAST/Data/ImagePyramid.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ ImagePyramid::ImagePyramid(int width, int height, int channels, int patchWidth,
7878
} else {
7979
if(compression == ImageCompression::UNSPECIFIED)
8080
compression = ImageCompression::JPEG;
81-
photometric = PHOTOMETRIC_RGB;
81+
if(compression == ImageCompression::JPEG) {
82+
photometric = PHOTOMETRIC_YCBCR; // JPEG is stored using YCBCR internally.
83+
// If this is not set to YCBCR for JPEG, OpenSlide will not display FAST created WSI tiffs correctly.
84+
} else {
85+
photometric = PHOTOMETRIC_RGB;
86+
}
8287
samplesPerPixel = 3; // RGBA image pyramid is converted to RGB with getPatchAsImage
8388
}
8489
m_compressionFormat = compression;

0 commit comments

Comments
 (0)