diff --git a/autotests/read/psd/cmyka-16bits.png b/autotests/read/psd/cmyka-16bits.png new file mode 100644 index 0000000..70bf860 Binary files /dev/null and b/autotests/read/psd/cmyka-16bits.png differ diff --git a/autotests/read/psd/cmyka-16bits.psd b/autotests/read/psd/cmyka-16bits.psd new file mode 100644 index 0000000..714c967 Binary files /dev/null and b/autotests/read/psd/cmyka-16bits.psd differ diff --git a/autotests/read/psd/cmyka-8bits.png b/autotests/read/psd/cmyka-8bits.png new file mode 100644 index 0000000..b296502 Binary files /dev/null and b/autotests/read/psd/cmyka-8bits.png differ diff --git a/autotests/read/psd/cmyka-8bits.psd b/autotests/read/psd/cmyka-8bits.psd new file mode 100644 index 0000000..00cb5b1 Binary files /dev/null and b/autotests/read/psd/cmyka-8bits.psd differ diff --git a/src/imageformats/psd.cpp b/src/imageformats/psd.cpp index 996f7d6..6dfc630 100644 --- a/src/imageformats/psd.cpp +++ b/src/imageformats/psd.cpp @@ -667,9 +667,10 @@ inline void cmykToRgb(uchar *target, qint32 targetChannels, const char *source, *(t + pt + 1) = T(std::min(max - (M * (1 - K) + K) * max + 0.5, max)); *(t + pt + 2) = T(std::min(max - (Y * (1 - K) + K) * max + 0.5, max)); if (targetChannels == 4) { - *(t + pt + 3) = std::numeric_limits::max(); if (sourceChannels == 5) - *(t + pt + 3) -= *(s + ps + 4); + *(t + pt + 3) = *(s + ps + 4); + else + *(t + pt + 3) = std::numeric_limits::max(); } } }