assume SAMPLEFORMAT_UINT for tiff files when SAMPLEFORMAT_VOID is set
This commit is contained in:
@@ -678,14 +678,17 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s
|
|||||||
return IMIO_VARIANTNOTSUPPORTED;
|
return IMIO_VARIANTNOTSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TIFFGetField(in, TIFFTAG_SAMPLEFORMAT, &sampleformat))
|
if (!TIFFGetField(in, TIFFTAG_SAMPLEFORMAT, &sampleformat)) {
|
||||||
/*
|
/*
|
||||||
* WARNING: This is a dirty hack!
|
* WARNING: This is a dirty hack!
|
||||||
* We assume that files which doesn't contain the TIFFTAG_SAMPLEFORMAT tag
|
* We assume that files which doesn't contain the TIFFTAG_SAMPLEFORMAT tag
|
||||||
* (which is the case with uncompressed TIFFs produced by RT!) are RGB files,
|
* (which is the case with uncompressed TIFFs produced by RT!) are RGB files,
|
||||||
* but that may be not true. --- Hombre
|
* but that may be not true. --- Hombre
|
||||||
*/
|
*/
|
||||||
{
|
sampleformat = SAMPLEFORMAT_UINT;
|
||||||
|
} else if (sampleformat == SAMPLEFORMAT_VOID) {
|
||||||
|
// according to https://www.awaresystems.be/imaging/tiff/tifftags/sampleformat.html
|
||||||
|
// we assume SAMPLEFORMAT_UINT if SAMPLEFORMAT_VOID is set
|
||||||
sampleformat = SAMPLEFORMAT_UINT;
|
sampleformat = SAMPLEFORMAT_UINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user