summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormsheby <44249925+msheby@users.noreply.github.com>2021-10-27 05:10:50 -0700
committerGitHub <noreply@github.com>2021-10-27 14:10:50 +0200
commit90481203a28d4d18052a07711d6d890ed1ab8c8a (patch)
tree45c0bf9b951a664ab3ce089d1da5aa3a2062072c /tests
parent9f70bf0ad1ba02fa3af87c552647bbc05c94c18e (diff)
opj_compress: add a -TargetBitDepth switch for TIFF output (#1384)
Sometimes, given the same (16-bit TIF) input, one wants to generate a variety of J2C outputs (say, 16-, 12-, and 10-bit). This patch allows one to downsample input files, and so makes it easier to automate OpenJPEG in mass generation of J2Cs without having to pipe though an image processing program.
Diffstat (limited to 'tests')
-rw-r--r--tests/compare_images.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/compare_images.c b/tests/compare_images.c
index 5e644f5a..f3f87639 100644
--- a/tests/compare_images.c
+++ b/tests/compare_images.c
@@ -260,6 +260,9 @@ static opj_image_t* readImageFromFileTIF(const char* filename,
{
opj_image_t* image_read = NULL;
opj_cparameters_t parameters;
+#ifdef OPJ_HAVE_LIBTIFF
+ const unsigned int target_bitdepth = 0;
+#endif
(void)nbFilenamePGX;
(void)separator;
@@ -284,7 +287,7 @@ static opj_image_t* readImageFromFileTIF(const char* filename,
/* Read the tif file corresponding to the component */
#ifdef OPJ_HAVE_LIBTIFF
- image_read = tiftoimage(filename, &parameters);
+ image_read = tiftoimage(filename, &parameters, target_bitdepth);
#endif
if (!image_read) {
fprintf(stderr, "Unable to load TIF file\n");