Solving issue 1776: "Support for TIFF files with alpha channel (RGBA)"

This commit is contained in:
natureh 510
2013-03-20 22:16:07 +01:00
parent ab22580efd
commit ea6b286325

View File

@@ -532,9 +532,8 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat,
TIFFClose(in);
if (samplesperpixel==3) {
if (photometric == PHOTOMETRIC_RGB) {
if (sampleformat==SAMPLEFORMAT_UINT) {
if ((samplesperpixel==3 || samplesperpixel==4) && sampleformat==SAMPLEFORMAT_UINT) {
if (bitspersample==8) {
sFormat = IIOSF_UNSIGNED_CHAR;
return IMIO_SUCCESS;
@@ -544,7 +543,7 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat,
return IMIO_SUCCESS;
}
}
else if (sampleformat==SAMPLEFORMAT_IEEEFP) {
else if (samplesperpixel==3 && sampleformat==SAMPLEFORMAT_IEEEFP) {
/*
* Not yet supported
*
@@ -552,13 +551,13 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat,
sFormat = IIOSF_HALF;
return IMIO_SUCCESS;
}*/
if (bitspersample==32) {
if ((samplesperpixel==3 || samplesperpixel==4) && bitspersample==32) {
sFormat = IIOSF_FLOAT;
return IMIO_SUCCESS;
}
}
}
else if (photometric == PHOTOMETRIC_LOGLUV) {
else if (samplesperpixel==3 && photometric == PHOTOMETRIC_LOGLUV) {
if (compression==COMPRESSION_SGILOG24) {
sFormat = IIOSF_LOGLUV24;
return IMIO_SUCCESS;
@@ -568,7 +567,6 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat,
return IMIO_SUCCESS;
}
}
}
return IMIO_VARIANTNOTSUPPORTED;
}