One of my problems with testing is that if I enable the testing on everyday basis, it takes a very long time to recompile everything each time I modify something. Also I’m in a very time consuming project right now…
I made these corrections more than one year ago, so it is not so fresh in my head.
First I found some bug while testing how itk reads metadata on a bunch of tif files provided by libtiff.
- when asked not to expand the palette, some tiff with 16 bits palette (not "directly’ supported by the reader) were detected and read as 8bit because the piece of code testing the palette type did not run.
- There is a use of
setExpandPalette instead of
Ideally, I think all the files provided by libtiff should be tested for correctness of metadata reading and also testing regressions. But I have no idea how this could be done…
I’ve also implemented writing image with palette for tiff and png image. By writing palette image, I mean writing a scalar image along with its colormap, not converting to rgb, like itk was doing before.
I try to apply the same logic as the read palette image:
- boolean WritePalette macro in itkImageIOBase.h
- add a set macro for the color palette in
itkTIFFImageIO.cpp, the logic for allocating palette and setting it to the file
It is limited to one palette by tiff file for multipage tiff, but more because I have no clear idea on how to have a proper interface for this. It would be trivial to adapt tough.