PSDTranslator: Fix index of alpha channel

This commit is contained in:
Gerasim Troeglazov
2013-12-20 09:04:30 +00:00
parent 0ff602f52a
commit 10b179b33d
+3 -3
View File
@@ -168,11 +168,11 @@ PSDWriter::Encode(BPositionIO *target)
if (fChannels == 4) { if (fChannels == 4) {
psdLayersSection << (int16)-1; // Alpha channel id (-1) psdLayersSection << (int16)-1; // Alpha channel id (-1)
if (fCompression == PSD_COMPRESSED_RAW) { if (fCompression == PSD_COMPRESSED_RAW) {
psdLayersSection << (uint32)(psdChannel[4].Length() psdLayersSection << (uint32)(psdChannel[3].Length()
+ sizeof(int16)); + sizeof(int16));
} else { } else {
psdLayersSection << (uint32)(psdChannel[4].Length() psdLayersSection << (uint32)(psdChannel[3].Length()
+ psdByteCounts[4].Length() + sizeof(int16)); + psdByteCounts[3].Length() + sizeof(int16));
} }
} }
psdLayersSection << "8BIM"; psdLayersSection << "8BIM";