psd: Header depth has to be 8 for CM_INDEXED color_mode

As suggested by Mirco Miranda
This commit is contained in:
Albert Astals Cid
2022-04-07 23:49:51 +02:00
parent 9e28aae868
commit bb475dedd1

View File

@ -498,7 +498,7 @@ static QImage::Format imageFormat(const PSDHeader &header)
format = header.depth == 8 ? QImage::Format_Grayscale8 : QImage::Format_Grayscale16;
break;
case CM_INDEXED:
format = QImage::Format_Indexed8;
format = header.depth == 8 ? QImage::Format_Indexed8 : QImage::Format_Invalid;
break;
case CM_BITMAP:
format = header.depth == 1 ? QImage::Format_Mono : QImage::Format_Invalid;