Support PSD 1 and 2 channel LayerRecords
Summary:
Hi,
This patch fixes some more photoshop file issues I been having. I've been using imagemagick to generate psd files for a while and it rather aggressively tries to reduce the amount of channels it writes. If it detects the layer is grayscale it will only write 1 channel (red) or 2 if it has alpha. This behaviour probably isn't correct but Photoshop is still able to open the files, and the missing channels are just set to white. This patch attempts to replicates what photoshop appears to doing and also fixes some potential segfaults if channelID are set wrong or trying to access out of bounds memory.
Reviewers: Krita, rempt
Reviewed By: Krita, rempt
Subscribers: dkazakov, rempt, woltherav
Tags: Krita
Differential Revision: https://phabricator.kde.org/D6475