From f417f056c5274c96b4176d5fbeede2cf2e2f699e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 11 Nov 2019 23:01:03 +0100 Subject: test/: add missing generated .sh files --- test/ppm2tiff_pbm.sh | 1 - test/ppm2tiff_pgm.sh | 1 - test/ppm2tiff_ppm.sh | 1 - test/tiff2bw-logluv-3c-16b.sh | 7 +++++++ test/tiff2bw-lzw-single-strip.sh | 7 +++++++ test/tiff2bw-minisblack-1c-16b.sh | 7 +++++++ test/tiff2bw-minisblack-1c-8b.sh | 7 +++++++ test/tiff2bw-minisblack-2c-8b-alpha.sh | 7 +++++++ test/tiff2bw-miniswhite-1c-1b.sh | 7 +++++++ test/tiff2bw-palette-1c-1b.sh | 7 +++++++ test/tiff2bw-palette-1c-4b.sh | 7 +++++++ test/tiff2bw-quad-tile.jpg.sh | 7 +++++++ test/tiff2bw-quad-tile.jpg.t1iff.sh | 7 +++++++ test/tiff2bw-rgb-3c-16b.sh | 7 +++++++ test/tiff2rgba-lzw-single-strip.sh | 7 +++++++ test/tiff2rgba-quad-lzw-compat.sh | 7 +++++++ test/tiff2rgba-quad-tile.jpg.t1iff.sh | 7 +++++++ test/tiffcrop-R90-lzw-single-strip.sh | 7 +++++++ test/tiffcrop-R90-quad-lzw-compat.sh | 7 +++++++ test/tiffcrop-R90-quad-tile.jpg.t1iff.sh | 7 +++++++ test/tiffcrop-doubleflip-lzw-single-strip.sh | 7 +++++++ test/tiffcrop-doubleflip-quad-lzw-compat.sh | 7 +++++++ test/tiffcrop-doubleflip-quad-tile.jpg.t1iff.sh | 7 +++++++ test/tiffcrop-extract-lzw-single-strip.sh | 7 +++++++ test/tiffcrop-extract-quad-lzw-compat.sh | 7 +++++++ test/tiffcrop-extract-quad-tile.jpg.t1iff.sh | 7 +++++++ test/tiffcrop-extractz14-lzw-single-strip.sh | 7 +++++++ test/tiffcrop-extractz14-quad-lzw-compat.sh | 7 +++++++ test/tiffcrop-extractz14-quad-tile.jpg.t1iff.sh | 7 +++++++ 29 files changed, 182 insertions(+), 3 deletions(-) create mode 100755 test/tiff2bw-logluv-3c-16b.sh create mode 100755 test/tiff2bw-lzw-single-strip.sh create mode 100755 test/tiff2bw-minisblack-1c-16b.sh create mode 100755 test/tiff2bw-minisblack-1c-8b.sh create mode 100755 test/tiff2bw-minisblack-2c-8b-alpha.sh create mode 100755 test/tiff2bw-miniswhite-1c-1b.sh create mode 100755 test/tiff2bw-palette-1c-1b.sh create mode 100755 test/tiff2bw-palette-1c-4b.sh create mode 100755 test/tiff2bw-quad-tile.jpg.sh create mode 100755 test/tiff2bw-quad-tile.jpg.t1iff.sh create mode 100755 test/tiff2bw-rgb-3c-16b.sh create mode 100755 test/tiff2rgba-lzw-single-strip.sh create mode 100755 test/tiff2rgba-quad-lzw-compat.sh create mode 100755 test/tiff2rgba-quad-tile.jpg.t1iff.sh create mode 100755 test/tiffcrop-R90-lzw-single-strip.sh create mode 100755 test/tiffcrop-R90-quad-lzw-compat.sh create mode 100755 test/tiffcrop-R90-quad-tile.jpg.t1iff.sh create mode 100755 test/tiffcrop-doubleflip-lzw-single-strip.sh create mode 100755 test/tiffcrop-doubleflip-quad-lzw-compat.sh create mode 100755 test/tiffcrop-doubleflip-quad-tile.jpg.t1iff.sh create mode 100755 test/tiffcrop-extract-lzw-single-strip.sh create mode 100755 test/tiffcrop-extract-quad-lzw-compat.sh create mode 100755 test/tiffcrop-extract-quad-tile.jpg.t1iff.sh create mode 100755 test/tiffcrop-extractz14-lzw-single-strip.sh create mode 100755 test/tiffcrop-extractz14-quad-lzw-compat.sh create mode 100755 test/tiffcrop-extractz14-quad-tile.jpg.t1iff.sh diff --git a/test/ppm2tiff_pbm.sh b/test/ppm2tiff_pbm.sh index 68d9e459..fb6c3cf7 100755 --- a/test/ppm2tiff_pbm.sh +++ b/test/ppm2tiff_pbm.sh @@ -1,5 +1,4 @@ #!/bin/sh -# Generated file, master is Makefile.am . ${srcdir:-.}/common.sh infile="$IMG_MINISWHITE_1C_1B_PBM" outfile="o-ppm2tiff_pbm.tiff" diff --git a/test/ppm2tiff_pgm.sh b/test/ppm2tiff_pgm.sh index 001ec706..60352348 100755 --- a/test/ppm2tiff_pgm.sh +++ b/test/ppm2tiff_pgm.sh @@ -1,5 +1,4 @@ #!/bin/sh -# Generated file, master is Makefile.am . ${srcdir:-.}/common.sh infile="$IMG_MINISBLACK_1C_8B_PGM" outfile="o-ppm2tiff_pgm.tiff" diff --git a/test/ppm2tiff_ppm.sh b/test/ppm2tiff_ppm.sh index 8a81527b..e213a71d 100755 --- a/test/ppm2tiff_ppm.sh +++ b/test/ppm2tiff_ppm.sh @@ -1,5 +1,4 @@ #!/bin/sh -# Generated file, master is Makefile.am . ${srcdir:-.}/common.sh infile="$IMG_RGB_3C_8B_PPM" outfile="o-ppm2tiff_ppm.tiff" diff --git a/test/tiff2bw-logluv-3c-16b.sh b/test/tiff2bw-logluv-3c-16b.sh new file mode 100755 index 00000000..9a64a1af --- /dev/null +++ b/test/tiff2bw-logluv-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/logluv-3c-16b.tiff" +outfile="o-tiff2bw-logluv-3c-16b.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-lzw-single-strip.sh b/test/tiff2bw-lzw-single-strip.sh new file mode 100755 index 00000000..def92097 --- /dev/null +++ b/test/tiff2bw-lzw-single-strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/lzw-single-strip.tiff" +outfile="o-tiff2bw-lzw-single-strip.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-minisblack-1c-16b.sh b/test/tiff2bw-minisblack-1c-16b.sh new file mode 100755 index 00000000..d0dee2c8 --- /dev/null +++ b/test/tiff2bw-minisblack-1c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-16b.tiff" +outfile="o-tiff2bw-minisblack-1c-16b.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-minisblack-1c-8b.sh b/test/tiff2bw-minisblack-1c-8b.sh new file mode 100755 index 00000000..c3437b95 --- /dev/null +++ b/test/tiff2bw-minisblack-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-8b.tiff" +outfile="o-tiff2bw-minisblack-1c-8b.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-minisblack-2c-8b-alpha.sh b/test/tiff2bw-minisblack-2c-8b-alpha.sh new file mode 100755 index 00000000..81f7b6d6 --- /dev/null +++ b/test/tiff2bw-minisblack-2c-8b-alpha.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-2c-8b-alpha.tiff" +outfile="o-tiff2bw-minisblack-2c-8b-alpha.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-miniswhite-1c-1b.sh b/test/tiff2bw-miniswhite-1c-1b.sh new file mode 100755 index 00000000..e3043c1f --- /dev/null +++ b/test/tiff2bw-miniswhite-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/miniswhite-1c-1b.tiff" +outfile="o-tiff2bw-miniswhite-1c-1b.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-palette-1c-1b.sh b/test/tiff2bw-palette-1c-1b.sh new file mode 100755 index 00000000..3862614e --- /dev/null +++ b/test/tiff2bw-palette-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-1b.tiff" +outfile="o-tiff2bw-palette-1c-1b.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-palette-1c-4b.sh b/test/tiff2bw-palette-1c-4b.sh new file mode 100755 index 00000000..21d8e90d --- /dev/null +++ b/test/tiff2bw-palette-1c-4b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-4b.tiff" +outfile="o-tiff2bw-palette-1c-4b.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-quad-tile.jpg.sh b/test/tiff2bw-quad-tile.jpg.sh new file mode 100755 index 00000000..29c2f40a --- /dev/null +++ b/test/tiff2bw-quad-tile.jpg.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.tiff" +outfile="o-tiff2bw-quad-tile.jpg.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-quad-tile.jpg.t1iff.sh b/test/tiff2bw-quad-tile.jpg.t1iff.sh new file mode 100755 index 00000000..1c507b37 --- /dev/null +++ b/test/tiff2bw-quad-tile.jpg.t1iff.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.t1iff" +outfile="o-tiff2bw-quad-tile.jpg.t1iff.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-rgb-3c-16b.sh b/test/tiff2bw-rgb-3c-16b.sh new file mode 100755 index 00000000..0ba9efb1 --- /dev/null +++ b/test/tiff2bw-rgb-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-16b.tiff" +outfile="o-tiff2bw-rgb-3c-16b.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2rgba-lzw-single-strip.sh b/test/tiff2rgba-lzw-single-strip.sh new file mode 100755 index 00000000..184a28d5 --- /dev/null +++ b/test/tiff2rgba-lzw-single-strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/lzw-single-strip.tiff" +outfile="o-tiff2rgba-lzw-single-strip.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2rgba-quad-lzw-compat.sh b/test/tiff2rgba-quad-lzw-compat.sh new file mode 100755 index 00000000..5ad808a5 --- /dev/null +++ b/test/tiff2rgba-quad-lzw-compat.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-lzw-compat.tiff" +outfile="o-tiff2rgba-quad-lzw-compat.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2rgba-quad-tile.jpg.t1iff.sh b/test/tiff2rgba-quad-tile.jpg.t1iff.sh new file mode 100755 index 00000000..9d553df6 --- /dev/null +++ b/test/tiff2rgba-quad-tile.jpg.t1iff.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.t1iff" +outfile="o-tiff2rgba-quad-tile.jpg.t1iff.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-R90-lzw-single-strip.sh b/test/tiffcrop-R90-lzw-single-strip.sh new file mode 100755 index 00000000..7b4fdbf9 --- /dev/null +++ b/test/tiffcrop-R90-lzw-single-strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/lzw-single-strip.tiff" +outfile="o-tiffcrop-R90-lzw-single-strip.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-R90-quad-lzw-compat.sh b/test/tiffcrop-R90-quad-lzw-compat.sh new file mode 100755 index 00000000..1a40412e --- /dev/null +++ b/test/tiffcrop-R90-quad-lzw-compat.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-lzw-compat.tiff" +outfile="o-tiffcrop-R90-quad-lzw-compat.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-R90-quad-tile.jpg.t1iff.sh b/test/tiffcrop-R90-quad-tile.jpg.t1iff.sh new file mode 100755 index 00000000..0d2bf973 --- /dev/null +++ b/test/tiffcrop-R90-quad-tile.jpg.t1iff.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.t1iff" +outfile="o-tiffcrop-R90-quad-tile.jpg.t1iff.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-doubleflip-lzw-single-strip.sh b/test/tiffcrop-doubleflip-lzw-single-strip.sh new file mode 100755 index 00000000..15351247 --- /dev/null +++ b/test/tiffcrop-doubleflip-lzw-single-strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/lzw-single-strip.tiff" +outfile="o-tiffcrop-doubleflip-lzw-single-strip.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-doubleflip-quad-lzw-compat.sh b/test/tiffcrop-doubleflip-quad-lzw-compat.sh new file mode 100755 index 00000000..5c482a5d --- /dev/null +++ b/test/tiffcrop-doubleflip-quad-lzw-compat.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-lzw-compat.tiff" +outfile="o-tiffcrop-doubleflip-quad-lzw-compat.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-doubleflip-quad-tile.jpg.t1iff.sh b/test/tiffcrop-doubleflip-quad-tile.jpg.t1iff.sh new file mode 100755 index 00000000..2e097126 --- /dev/null +++ b/test/tiffcrop-doubleflip-quad-tile.jpg.t1iff.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.t1iff" +outfile="o-tiffcrop-doubleflip-quad-tile.jpg.t1iff.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extract-lzw-single-strip.sh b/test/tiffcrop-extract-lzw-single-strip.sh new file mode 100755 index 00000000..58041a23 --- /dev/null +++ b/test/tiffcrop-extract-lzw-single-strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/lzw-single-strip.tiff" +outfile="o-tiffcrop-extract-lzw-single-strip.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extract-quad-lzw-compat.sh b/test/tiffcrop-extract-quad-lzw-compat.sh new file mode 100755 index 00000000..bade2456 --- /dev/null +++ b/test/tiffcrop-extract-quad-lzw-compat.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-lzw-compat.tiff" +outfile="o-tiffcrop-extract-quad-lzw-compat.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extract-quad-tile.jpg.t1iff.sh b/test/tiffcrop-extract-quad-tile.jpg.t1iff.sh new file mode 100755 index 00000000..11834416 --- /dev/null +++ b/test/tiffcrop-extract-quad-tile.jpg.t1iff.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.t1iff" +outfile="o-tiffcrop-extract-quad-tile.jpg.t1iff.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extractz14-lzw-single-strip.sh b/test/tiffcrop-extractz14-lzw-single-strip.sh new file mode 100755 index 00000000..022ab76f --- /dev/null +++ b/test/tiffcrop-extractz14-lzw-single-strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/lzw-single-strip.tiff" +outfile="o-tiffcrop-extractz14-lzw-single-strip.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extractz14-quad-lzw-compat.sh b/test/tiffcrop-extractz14-quad-lzw-compat.sh new file mode 100755 index 00000000..3fe169c3 --- /dev/null +++ b/test/tiffcrop-extractz14-quad-lzw-compat.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-lzw-compat.tiff" +outfile="o-tiffcrop-extractz14-quad-lzw-compat.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extractz14-quad-tile.jpg.t1iff.sh b/test/tiffcrop-extractz14-quad-tile.jpg.t1iff.sh new file mode 100755 index 00000000..5d36e7da --- /dev/null +++ b/test/tiffcrop-extractz14-quad-tile.jpg.t1iff.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.t1iff" +outfile="o-tiffcrop-extractz14-quad-tile.jpg.t1iff.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile -- cgit v1.2.1 From 0356ea76bac908c61160d735f078437ace953bd3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 11 Nov 2019 23:02:08 +0100 Subject: OJPEG: fix broken sanity check added in 4.1.0, and add two OJPEG test files --- libtiff/tif_ojpeg.c | 53 +++++++++------------ test/CMakeLists.txt | 8 +++- test/Makefile.am | 9 +++- .../images/ojpeg_chewey_subsamp21_multi_strip.tiff | Bin 0 -> 39752 bytes .../ojpeg_zackthecat_subsamp22_single_strip.tiff | Bin 0 -> 8258 bytes test/tiff2bw-ojpeg_chewey_subsamp21_multi_strip.sh | 7 +++ ...f2bw-ojpeg_zackthecat_subsamp22_single_strip.sh | 7 +++ ...tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh | 7 +++ ...rgba-ojpeg_zackthecat_subsamp22_single_strip.sh | 7 +++ ...fcrop-R90-ojpeg_chewey_subsamp21_multi_strip.sh | 7 +++ ...-R90-ojpeg_zackthecat_subsamp22_single_strip.sh | 7 +++ ...oubleflip-ojpeg_chewey_subsamp21_multi_strip.sh | 7 +++ ...flip-ojpeg_zackthecat_subsamp22_single_strip.sh | 7 +++ ...p-extract-ojpeg_chewey_subsamp21_multi_strip.sh | 7 +++ ...ract-ojpeg_zackthecat_subsamp22_single_strip.sh | 7 +++ ...xtractz14-ojpeg_chewey_subsamp21_multi_strip.sh | 7 +++ ...tz14-ojpeg_zackthecat_subsamp22_single_strip.sh | 7 +++ 17 files changed, 120 insertions(+), 34 deletions(-) create mode 100644 test/images/ojpeg_chewey_subsamp21_multi_strip.tiff create mode 100644 test/images/ojpeg_zackthecat_subsamp22_single_strip.tiff create mode 100755 test/tiff2bw-ojpeg_chewey_subsamp21_multi_strip.sh create mode 100755 test/tiff2bw-ojpeg_zackthecat_subsamp22_single_strip.sh create mode 100755 test/tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh create mode 100755 test/tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.sh create mode 100755 test/tiffcrop-R90-ojpeg_chewey_subsamp21_multi_strip.sh create mode 100755 test/tiffcrop-R90-ojpeg_zackthecat_subsamp22_single_strip.sh create mode 100755 test/tiffcrop-doubleflip-ojpeg_chewey_subsamp21_multi_strip.sh create mode 100755 test/tiffcrop-doubleflip-ojpeg_zackthecat_subsamp22_single_strip.sh create mode 100755 test/tiffcrop-extract-ojpeg_chewey_subsamp21_multi_strip.sh create mode 100755 test/tiffcrop-extract-ojpeg_zackthecat_subsamp22_single_strip.sh create mode 100755 test/tiffcrop-extractz14-ojpeg_chewey_subsamp21_multi_strip.sh create mode 100755 test/tiffcrop-extractz14-ojpeg_zackthecat_subsamp22_single_strip.sh diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c index bf0d1a2a..d6f7d97e 100644 --- a/libtiff/tif_ojpeg.c +++ b/libtiff/tif_ojpeg.c @@ -837,36 +837,6 @@ OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc) { if (sp->subsampling_convert_state==0) { - const jpeg_decompress_struct* cinfo = &sp->libjpeg_jpeg_decompress_struct; - int width = 0; - int last_col_width = 0; - int jpeg_bytes; - int expected_bytes; - int i; - if (cinfo->MCUs_per_row == 0) - { - sp->error_in_raw_data_decoding = 1; - return 0; - } - for (i = 0; i < cinfo->comps_in_scan; ++i) - { - const jpeg_component_info* info = cinfo->cur_comp_info[i]; -#if JPEG_LIB_VERSION >= 70 - width += info->MCU_width * info->DCT_h_scaled_size; - last_col_width += info->last_col_width * info->DCT_h_scaled_size; -#else - width += info->MCU_width * info->DCT_scaled_size; - last_col_width += info->last_col_width * info->DCT_scaled_size; -#endif - } - jpeg_bytes = (cinfo->MCUs_per_row - 1) * width + last_col_width; - expected_bytes = sp->subsampling_convert_clinelenout * sp->subsampling_ver * sp->subsampling_hor; - if (jpeg_bytes != expected_bytes) - { - TIFFErrorExt(tif->tif_clientdata,module,"Inconsistent number of MCU in codestream"); - sp->error_in_raw_data_decoding = 1; - return(0); - } if (jpeg_read_raw_data_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),sp->subsampling_convert_ycbcrimage,sp->subsampling_ver*8)==0) { sp->error_in_raw_data_decoding = 1; @@ -1291,6 +1261,29 @@ OJPEGWriteHeaderInfo(TIFF* tif) } if (jpeg_start_decompress_encap(sp,&(sp->libjpeg_jpeg_decompress_struct))==0) return(0); + if(sp->libjpeg_jpeg_decompress_struct.image_width != sp->strile_width || + sp->libjpeg_jpeg_decompress_struct.image_height < sp->strile_length) { + TIFFErrorExt(tif->tif_clientdata,module, + "jpeg_start_decompress() returned image_width = %d " + "and image_height = %d, expected %d and %d", + sp->libjpeg_jpeg_decompress_struct.image_width, + sp->libjpeg_jpeg_decompress_struct.image_height, + sp->strile_width, + sp->strile_length); + return 0; + } + if(sp->libjpeg_jpeg_decompress_struct.max_h_samp_factor != sp->subsampling_hor || + sp->libjpeg_jpeg_decompress_struct.max_v_samp_factor != sp->subsampling_ver) { + TIFFErrorExt(tif->tif_clientdata,module, + "jpeg_start_decompress() returned max_h_samp_factor = %d " + "and max_v_samp_factor = %d, expected %d and %d", + sp->libjpeg_jpeg_decompress_struct.max_h_samp_factor, + sp->libjpeg_jpeg_decompress_struct.max_v_samp_factor, + sp->subsampling_hor, + sp->subsampling_ver); + return 0; + } + sp->writeheader_done=1; return(1); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a4216d56..c89bb824 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -105,7 +105,9 @@ set(TESTSCRIPTS tiff2rgba-palette-1c-8b.sh tiff2rgba-rgb-3c-16b.sh tiff2rgba-rgb-3c-8b.sh - tiff2rgba-quad-tile.jpg.sh) + tiff2rgba-quad-tile.jpg.sh + tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.sh + tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh) # This list should contain all of the TIFF files in the 'images' # subdirectory which are intended to be used as input images for @@ -123,7 +125,9 @@ set(TIFFIMAGES images/rgb-3c-8b.tiff images/quad-tile.jpg.tiff images/quad-lzw-compat.tiff - images/lzw-single-strip.tiff) + images/lzw-single-strip.tiff + images/ojpeg_zackthecat_subsamp22_single_strip.tiff + images/ojpeg_chewey_subsamp21_multi_strip.tiff) set(BMPIMAGES images/palette-1c-8b.bmp diff --git a/test/Makefile.am b/test/Makefile.am index 90c2f3d1..420d7523 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -55,7 +55,10 @@ CLEANFILES = test_packbits.tif o-* if HAVE_JPEG JPEG_DEPENDENT_CHECK_PROG=raw_decode JPEG_DEPENDENT_TESTSCRIPTS=\ - tiff2rgba-quad-tile.jpg.sh + tiff2rgba-quad-tile.jpg.sh \ + tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.sh \ + tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh + else JPEG_DEPENDENT_CHECK_PROG= JPEG_DEPENDENT_TESTSCRIPTS= @@ -171,7 +174,9 @@ TIFFIMAGES = \ images/rgb-3c-8b.tiff \ images/quad-tile.jpg.tiff \ images/quad-lzw-compat.tiff \ - images/lzw-single-strip.tiff + images/lzw-single-strip.tiff \ + images/ojpeg_zackthecat_subsamp22_single_strip.tiff \ + images/ojpeg_chewey_subsamp21_multi_strip.tiff PNMIMAGES = \ images/minisblack-1c-8b.pgm \ diff --git a/test/images/ojpeg_chewey_subsamp21_multi_strip.tiff b/test/images/ojpeg_chewey_subsamp21_multi_strip.tiff new file mode 100644 index 00000000..8b04d473 Binary files /dev/null and b/test/images/ojpeg_chewey_subsamp21_multi_strip.tiff differ diff --git a/test/images/ojpeg_zackthecat_subsamp22_single_strip.tiff b/test/images/ojpeg_zackthecat_subsamp22_single_strip.tiff new file mode 100644 index 00000000..15185b68 Binary files /dev/null and b/test/images/ojpeg_zackthecat_subsamp22_single_strip.tiff differ diff --git a/test/tiff2bw-ojpeg_chewey_subsamp21_multi_strip.sh b/test/tiff2bw-ojpeg_chewey_subsamp21_multi_strip.sh new file mode 100755 index 00000000..61a2ccf5 --- /dev/null +++ b/test/tiff2bw-ojpeg_chewey_subsamp21_multi_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_chewey_subsamp21_multi_strip.tiff" +outfile="o-tiff2bw-ojpeg_chewey_subsamp21_multi_strip.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2bw-ojpeg_zackthecat_subsamp22_single_strip.sh b/test/tiff2bw-ojpeg_zackthecat_subsamp22_single_strip.sh new file mode 100755 index 00000000..7b09ded9 --- /dev/null +++ b/test/tiff2bw-ojpeg_zackthecat_subsamp22_single_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_zackthecat_subsamp22_single_strip.tiff" +outfile="o-tiff2bw-ojpeg_zackthecat_subsamp22_single_strip.tiff" +f_test_convert "$TIFF2BW" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh b/test/tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh new file mode 100755 index 00000000..d1225c94 --- /dev/null +++ b/test/tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_chewey_subsamp21_multi_strip.tiff" +outfile="o-tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.sh b/test/tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.sh new file mode 100755 index 00000000..ca23a12d --- /dev/null +++ b/test/tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_zackthecat_subsamp22_single_strip.tiff" +outfile="o-tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-R90-ojpeg_chewey_subsamp21_multi_strip.sh b/test/tiffcrop-R90-ojpeg_chewey_subsamp21_multi_strip.sh new file mode 100755 index 00000000..41df587d --- /dev/null +++ b/test/tiffcrop-R90-ojpeg_chewey_subsamp21_multi_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_chewey_subsamp21_multi_strip.tiff" +outfile="o-tiffcrop-R90-ojpeg_chewey_subsamp21_multi_strip.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-R90-ojpeg_zackthecat_subsamp22_single_strip.sh b/test/tiffcrop-R90-ojpeg_zackthecat_subsamp22_single_strip.sh new file mode 100755 index 00000000..61f8fc41 --- /dev/null +++ b/test/tiffcrop-R90-ojpeg_zackthecat_subsamp22_single_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_zackthecat_subsamp22_single_strip.tiff" +outfile="o-tiffcrop-R90-ojpeg_zackthecat_subsamp22_single_strip.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-doubleflip-ojpeg_chewey_subsamp21_multi_strip.sh b/test/tiffcrop-doubleflip-ojpeg_chewey_subsamp21_multi_strip.sh new file mode 100755 index 00000000..3196ae1d --- /dev/null +++ b/test/tiffcrop-doubleflip-ojpeg_chewey_subsamp21_multi_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_chewey_subsamp21_multi_strip.tiff" +outfile="o-tiffcrop-doubleflip-ojpeg_chewey_subsamp21_multi_strip.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-doubleflip-ojpeg_zackthecat_subsamp22_single_strip.sh b/test/tiffcrop-doubleflip-ojpeg_zackthecat_subsamp22_single_strip.sh new file mode 100755 index 00000000..6ce71d4f --- /dev/null +++ b/test/tiffcrop-doubleflip-ojpeg_zackthecat_subsamp22_single_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_zackthecat_subsamp22_single_strip.tiff" +outfile="o-tiffcrop-doubleflip-ojpeg_zackthecat_subsamp22_single_strip.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extract-ojpeg_chewey_subsamp21_multi_strip.sh b/test/tiffcrop-extract-ojpeg_chewey_subsamp21_multi_strip.sh new file mode 100755 index 00000000..bb30f9bd --- /dev/null +++ b/test/tiffcrop-extract-ojpeg_chewey_subsamp21_multi_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_chewey_subsamp21_multi_strip.tiff" +outfile="o-tiffcrop-extract-ojpeg_chewey_subsamp21_multi_strip.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extract-ojpeg_zackthecat_subsamp22_single_strip.sh b/test/tiffcrop-extract-ojpeg_zackthecat_subsamp22_single_strip.sh new file mode 100755 index 00000000..ce06a261 --- /dev/null +++ b/test/tiffcrop-extract-ojpeg_zackthecat_subsamp22_single_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_zackthecat_subsamp22_single_strip.tiff" +outfile="o-tiffcrop-extract-ojpeg_zackthecat_subsamp22_single_strip.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extractz14-ojpeg_chewey_subsamp21_multi_strip.sh b/test/tiffcrop-extractz14-ojpeg_chewey_subsamp21_multi_strip.sh new file mode 100755 index 00000000..81d66249 --- /dev/null +++ b/test/tiffcrop-extractz14-ojpeg_chewey_subsamp21_multi_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_chewey_subsamp21_multi_strip.tiff" +outfile="o-tiffcrop-extractz14-ojpeg_chewey_subsamp21_multi_strip.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/test/tiffcrop-extractz14-ojpeg_zackthecat_subsamp22_single_strip.sh b/test/tiffcrop-extractz14-ojpeg_zackthecat_subsamp22_single_strip.sh new file mode 100755 index 00000000..e6c3c5f3 --- /dev/null +++ b/test/tiffcrop-extractz14-ojpeg_zackthecat_subsamp22_single_strip.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/ojpeg_zackthecat_subsamp22_single_strip.tiff" +outfile="o-tiffcrop-extractz14-ojpeg_zackthecat_subsamp22_single_strip.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile -- cgit v1.2.1