Skip to content

Commit 9c128ed

Browse files
committed
PluginTIFF: fixed wrongly disabled ICC for CMYK without conversion
1 parent a69a58a commit 9c128ed

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Source/Plugins/PluginTIFF.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
14421442
TIFFLoadMethod loadMethod = FindLoadMethod(tif, image_type, flags);
14431443

14441444
// ---------------------------------------------------------------------------------
1445+
bool discardIcc{ false };
14451446

14461447
std::unique_ptr<FIBITMAP, decltype(&FreeImage_Unload)> dib(nullptr, &FreeImage_Unload);
14471448
if (loadMethod == LoadAsRBGA) {
@@ -1837,6 +1838,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
18371838

18381839
if (!asCMYK) {
18391840
ConvertCMYKtoRGBA(dib.get());
1841+
discardIcc = true;
18401842

18411843
if (isCMYKA) {
18421844
// HACK until we have Extra channels. (ConvertCMYKtoRGBA will then do the work)
@@ -2290,7 +2292,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
22902292

22912293
// copy ICC profile data (must be done after FreeImage_Allocate)
22922294

2293-
if (!asCMYK) {
2295+
if (!discardIcc) {
22942296
uint32_t iccSize = 0; // ICC profile length
22952297
void* iccBuf{}; // ICC profile data
22962298
TIFFGetField(tif, TIFFTAG_ICCPROFILE, &iccSize, &iccBuf);

0 commit comments

Comments
 (0)