Number of colors in bitmap thumbnail


I noticed that for .dng files with bitmap thumbnail LibRaw claims that there is no color in the preview (thumbnail.tcolors = 0 after open_file() + unpack_thumb()).
Shouldn't it return 3 colors (tcolors = 3) as from documentation LIBRAW_THUMBNAIL_BITMAP preview contains RGB bitmap?

Example files:

Thank you,


Agree, it would be better to

Agree, it would be better to initialize this field into correct value, at least if preview IFD contains SamplesPerPixel tag.

I need to collect more samples (at least color DNG + BW preview) to implement it in correct way (unpack_thumb assumes 3 colors for PPM bitmaps, this may be not correct and will result into read beyond EOF).

Expect fix in 0.19-snapshot coming soon.

-- Alex Tutubalin