From 10b179b33d5896d2e2c521c377e53b1a9890b0d7 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Fri, 20 Dec 2013 09:04:30 +0000 Subject: [PATCH] PSDTranslator: Fix index of alpha channel --- src/add-ons/translators/psd/PSDWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/add-ons/translators/psd/PSDWriter.cpp b/src/add-ons/translators/psd/PSDWriter.cpp index 11f68edef5..b39d5fb500 100644 --- a/src/add-ons/translators/psd/PSDWriter.cpp +++ b/src/add-ons/translators/psd/PSDWriter.cpp @@ -168,11 +168,11 @@ PSDWriter::Encode(BPositionIO *target) if (fChannels == 4) { psdLayersSection << (int16)-1; // Alpha channel id (-1) if (fCompression == PSD_COMPRESSED_RAW) { - psdLayersSection << (uint32)(psdChannel[4].Length() + psdLayersSection << (uint32)(psdChannel[3].Length() + sizeof(int16)); } else { - psdLayersSection << (uint32)(psdChannel[4].Length() - + psdByteCounts[4].Length() + sizeof(int16)); + psdLayersSection << (uint32)(psdChannel[3].Length() + + psdByteCounts[3].Length() + sizeof(int16)); } } psdLayersSection << "8BIM";