dcraw: use the right black levels for linear DNGs (#6444)
Linear dng (like the one created by Adobe DNG Converter) contains multiple tiff subifd with different kind of images (the Primary Image and multiple previews), these defines different kind of black levels. Currently dcraw has a global cblack array that is overwritten by the last parsed tiff ifd. With such kind of linear dng it's the last subifd. The causes the use of the wrong black levels with the image having usually a magenta color cast. The dng spec uses the NewSubFileType tag to define the primary image with tag value as 0. This patch reads also the NewSubFileType tag and populates the cblack array provided by the other tags only if it's the primary image.
This commit is contained in:
@@ -209,7 +209,7 @@ protected:
|
||||
} first_decode[2048], *second_decode, *free_decode;
|
||||
|
||||
struct tiff_ifd {
|
||||
int width, height, bps, comp, phint, offset, flip, samples, bytes;
|
||||
int new_sub_file_type, width, height, bps, comp, phint, offset, flip, samples, bytes;
|
||||
int tile_width, tile_length, sample_format, predictor;
|
||||
float shutter;
|
||||
} tiff_ifd[10];
|
||||
|
Reference in New Issue
Block a user