TIFF_READ does not support complex integers
tiff.cxx does not include provision for reading complex integer formats (typical for synthetic aperture radar data). Suggest the below case which interprets them as various integer types that can be decoded by the user later.
case TIFF::Directory::SampleFormat::ComplexInteger:
switch(bitsPerSample) {
case 16: pixelType = GDL_INT; break;
case 32: pixelType = GDL_LONG; break;
case 64: pixelType = GDL_LONG64; break;
default: printf(BPS_ERR_FMT, "COMPLEXINT", bitsPerSample);
} break;
to then decode complex 32-bit integers (16 bits real, 16 bits imaginary), for example, c = complex(fix(i and 65535), fix(i / 65536)).
Thank you @sjfrasier! Let's create a PR for this change. Could you also supply a test code (and test file) that uses the added logic? Thanks, Sylwester
Haven't done a PR before and don't want to break anything. Any advice?
go ahead ! If you broke somethings in the code, the CI system will complain.
I think I did it, though maybe only on my own fork? Realizing I can't truly give you a test image because I cannot actually make a tiff file with the ComplexInteger tiff data type embedded, and I cannot share ones that I have due to data licensing. But it does work...
@sjfrasier to create a PR, you need to point Github to a branch where your modifications are stored: https://github.com/gnudatalanguage/gdl/compare
so far, there is no PR from you registered yet
looks we have a PR today...