Solving issue 1776: "Support for TIFF files with alpha channel (RGBA)"
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user