mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-28 00:00:03 -04:00
#383 PSD CMYK > 5 channels fix
This commit is contained in:
+3
-3
@@ -227,19 +227,19 @@ public final class PSDImageReader extends ImageReaderBase {
|
|||||||
if (header.channels == 4 && header.bits == 8) {
|
if (header.channels == 4 && header.bits == 8) {
|
||||||
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3}, new int[] {0, 0, 0, 0}, DataBuffer.TYPE_BYTE, false, false);
|
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3}, new int[] {0, 0, 0, 0}, DataBuffer.TYPE_BYTE, false, false);
|
||||||
}
|
}
|
||||||
else if (header.channels == 5 && header.bits == 8) {
|
else if (header.channels >= 5 && header.bits == 8) {
|
||||||
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3, 4}, new int[] {0, 0, 0, 0, 0}, DataBuffer.TYPE_BYTE, true, false);
|
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3, 4}, new int[] {0, 0, 0, 0, 0}, DataBuffer.TYPE_BYTE, true, false);
|
||||||
}
|
}
|
||||||
else if (header.channels == 4 && header.bits == 16) {
|
else if (header.channels == 4 && header.bits == 16) {
|
||||||
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3}, new int[] {0, 0, 0, 0}, DataBuffer.TYPE_USHORT, false, false);
|
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3}, new int[] {0, 0, 0, 0}, DataBuffer.TYPE_USHORT, false, false);
|
||||||
}
|
}
|
||||||
else if (header.channels == 5 && header.bits == 16) {
|
else if (header.channels >= 5 && header.bits == 16) {
|
||||||
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3, 4}, new int[] {0, 0, 0, 0, 0}, DataBuffer.TYPE_USHORT, true, false);
|
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3, 4}, new int[] {0, 0, 0, 0, 0}, DataBuffer.TYPE_USHORT, true, false);
|
||||||
}
|
}
|
||||||
else if (header.channels == 4 && header.bits == 32) {
|
else if (header.channels == 4 && header.bits == 32) {
|
||||||
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3}, new int[] {0, 0, 0, 0}, DataBuffer.TYPE_INT, false, false);
|
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3}, new int[] {0, 0, 0, 0}, DataBuffer.TYPE_INT, false, false);
|
||||||
}
|
}
|
||||||
else if (header.channels == 5 && header.bits == 32) {
|
else if (header.channels >= 5 && header.bits == 32) {
|
||||||
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3, 4}, new int[] {0, 0, 0, 0, 0}, DataBuffer.TYPE_INT, true, false);
|
return ImageTypeSpecifiers.createBanded(cs, new int[] {0, 1, 2, 3, 4}, new int[] {0, 0, 0, 0, 0}, DataBuffer.TYPE_INT, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -114,10 +114,9 @@ final class PSDLayerMaskData {
|
|||||||
if (dataLeft >= 2) {
|
if (dataLeft >= 2) {
|
||||||
// Real Flags. Same as Flags information above.
|
// Real Flags. Same as Flags information above.
|
||||||
flags = pInput.readUnsignedByte();
|
flags = pInput.readUnsignedByte();
|
||||||
dataLeft--;
|
|
||||||
// Real user mask background. 0 or 255.
|
// Real user mask background. 0 or 255.
|
||||||
defaultColor = pInput.readUnsignedByte();
|
defaultColor = pInput.readUnsignedByte();
|
||||||
dataLeft--;
|
dataLeft -= 2;
|
||||||
}
|
}
|
||||||
if (dataLeft >= 16) {
|
if (dataLeft >= 16) {
|
||||||
// Rectangle enclosing layer mask: Top, left, bottom, right.
|
// Rectangle enclosing layer mask: Top, left, bottom, right.
|
||||||
|
|||||||
Reference in New Issue
Block a user