Added metadata support for 16 bit USHORT gray.
@@ -193,10 +193,13 @@ final class TGAMetadata extends AbstractMetadata {
switch (header.getPixelDepth()) {
case 8:
- bitsPerSample.setAttribute("value", createListValue(1, Integer.toString(header.getPixelDepth())));
+ bitsPerSample.setAttribute("value", createListValue(1, "8"));
break;
case 16:
- if (header.getAttributeBits() > 0 && extensions != null && extensions.hasAlpha()) {
+ if (header.getImageType() == TGA.IMAGETYPE_MONOCHROME || header.getImageType() == TGA.IMAGETYPE_MONOCHROME_RLE) {
+ bitsPerSample.setAttribute("value", "16");
+ }
+ else if (header.getAttributeBits() > 0 && extensions != null && extensions.hasAlpha()) {
bitsPerSample.setAttribute("value", "5, 5, 5, 1");
}
else {
