Just has our in house support throw this file my way. Turns out that there is 7 directories in the TIFF file and one of them (the 4th) is grey scale with an alpha channel, and the code in TTiffFileFormat.LoadData, line 327 that reads
if Info.ChannelCount > 1 then
SwapChannels(Images[Idx], ChannelRed, ChannelBlue);
tries to swap non existent red and blues channels. Interestingly enough the comment above the definitions for ChannerlBlue/Red/Green/Alpha mentions that these can only be used for ARGB images, but in this case there is no checking that the TIFF directory has an ARGB image format, it makes the assumption based on number of channels.
I also note that the saving code forther down in the source makes the same assumption that more than 1 channel implies that there are RGB channels available. So any fixes needs to be handled in both places in the code.
I'm going to hack my source to work for now, but I'm not familiar with the code base to make a correct determination on which ImageFormat types that the channels should be swapped.
Cheers, Max.
if Info.ChannelCount > 1 then
SwapChannels(Images[Idx], ChannelRed, ChannelBlue);
tries to swap non existent red and blues channels. Interestingly enough the comment above the definitions for ChannerlBlue/Red/Green/Alpha mentions that these can only be used for ARGB images, but in this case there is no checking that the TIFF directory has an ARGB image format, it makes the assumption based on number of channels.
I also note that the saving code forther down in the source makes the same assumption that more than 1 channel implies that there are RGB channels available. So any fixes needs to be handled in both places in the code.
I'm going to hack my source to work for now, but I'm not familiar with the code base to make a correct determination on which ImageFormat types that the channels should be swapped.
Cheers, Max.