diff --git a/autotests/read/psd/53alphas.png b/autotests/read/psd/53alphas.png new file mode 100644 index 0000000..3987b5e Binary files /dev/null and b/autotests/read/psd/53alphas.png differ diff --git a/autotests/read/psd/53alphas.psd b/autotests/read/psd/53alphas.psd new file mode 100644 index 0000000..8aa90a4 Binary files /dev/null and b/autotests/read/psd/53alphas.psd differ diff --git a/src/imageformats/psd.cpp b/src/imageformats/psd.cpp index 7447fa1..80a61b2 100644 --- a/src/imageformats/psd.cpp +++ b/src/imageformats/psd.cpp @@ -643,7 +643,9 @@ static bool IsValid(const PSDHeader &header) qDebug() << "PSD header: invalid color mode" << header.color_mode; return false; } - if (header.channel_count < 1 || header.channel_count > 56) { + // Specs tells: "Supported range is 1 to 56" but the limit is 57: + // Photoshop does not make you add more (see also 53alphas.psd test case). + if (header.channel_count < 1 || header.channel_count > 57) { qDebug() << "PSD header: invalid number of channels" << header.channel_count; return false; }