diff options
author | Jean-Michel Hautbois via libcamera-devel <libcamera-devel@lists.libcamera.org> | 2022-06-16 10:49:41 +0200 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2022-10-17 20:40:14 +0900 |
commit | ae7809307e798ae32f4c978882aca94249ce7fd7 (patch) | |
tree | e3eb6b923818ac5bcb9c7e003f2cfd0413c5b3b5 /src | |
parent | f4201e9636f4460ad0eacdf32aac43c70c6bf95c (diff) |
qcam: dng: Make TIFFTAG_CFAPATTERN variable count
Since libtiff version 20201219, the CFAPATTERN tag is using a variable
count and not the fixed 4 values size.
For reference, the commit introducing this is:
commit 2eb5a954cb7b7ad61559da00743c4b0e2fce34d0
Author: Sam Hasinoff <hasinoff@google.com>
Date: Sun Mar 8 21:23:16 2020 +0100
Make TIFFTAG_CFAPATTERN variable count
Add a version check in the DNGWriter::write function when this tag is
written as this breaks the raw capture in qcam.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qcam/dng_writer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp index b4362537..6dd7d0f4 100644 --- a/src/qcam/dng_writer.cpp +++ b/src/qcam/dng_writer.cpp @@ -507,7 +507,10 @@ int DNGWriter::write(const char *filename, const Camera *camera, TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField(tif, TIFFTAG_CFAREPEATPATTERNDIM, cfaRepeatPatternDim); - TIFFSetField(tif, TIFFTAG_CFAPATTERN, info->pattern); + if (TIFFLIB_VERSION < 20201219) + TIFFSetField(tif, TIFFTAG_CFAPATTERN, info->pattern); + else + TIFFSetField(tif, TIFFTAG_CFAPATTERN, 4, info->pattern); TIFFSetField(tif, TIFFTAG_CFAPLANECOLOR, 3, cfaPlaneColor); TIFFSetField(tif, TIFFTAG_CFALAYOUT, 1); |