diff --git a/Cargo.toml b/Cargo.toml index bacd5d9..f90327a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,8 @@ image-webp = {version = "0.2.4", optional = true } criterion = "0.3.1" # We may already depend on this via flate2 crc32fast = "1.5" +libtest-mimic = "0.8.1" +walkdir = "2.5" [features] default = ["deflate", "fax", "jpeg", "lzw"] @@ -47,3 +49,8 @@ zstd = ["dep:zstd"] [[bench]] name = "lzw" harness = false + +[[test]] +name = "decode_libtiffpic" +path = "tests/decode_libtiffpic.rs" +harness = false diff --git a/tests/COPYRIGHT b/tests/COPYRIGHT index 0d8a28a..7b9e2b7 100644 --- a/tests/COPYRIGHT +++ b/tests/COPYRIGHT @@ -6,3 +6,7 @@ usda/*.tif url: https://registry.opendata.aws/naip/index.html credit: NAIP on AWS was accessed on 2026-01-28 from https://registry.opendata.aws/naip. license: Public Domain +libtiffpic/ + url: https://download.osgeo.org/libtiff/ + credit: libtiff + license: CC0 diff --git a/tests/decode_libtiffpic.rs b/tests/decode_libtiffpic.rs new file mode 100644 index 0000000..0ab0dca --- /dev/null +++ b/tests/decode_libtiffpic.rs @@ -0,0 +1,169 @@ +use std::collections::HashMap; +use std::{fs::File, path}; + +use tiff::decoder::{Decoder, DecodingResult}; + +use libtest_mimic::{Arguments, Failed, Trial}; +use walkdir::WalkDir; + +const REFERENCE_DIR: &str = "tests/libtiffpic"; + +// `find test/libtiffpic -type f | sort` +const FILES: &[(&str, bool)] = &[ + ("tests/libtiffpic/caspian.tif", true), + ("tests/libtiffpic/cramps.tif", true), + // FIXME: See , this has tiles as + // StripOffsets and has a RowsPerStrip. + ("tests/libtiffpic/cramps-tile.tif", false), + ("tests/libtiffpic/CVS/Entries", false), + ("tests/libtiffpic/CVS/Repository", false), + ("tests/libtiffpic/CVS/Root", false), + ("tests/libtiffpic/depth/CVS/Entries", false), + ("tests/libtiffpic/depth/CVS/Repository", false), + ("tests/libtiffpic/depth/CVS/Root", false), + ("tests/libtiffpic/depth/flower-minisblack-02.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-04.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-06.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-08.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-10.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-12.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-14.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-16.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-24.tif", true), + ("tests/libtiffpic/depth/flower-minisblack-32.tif", true), + ("tests/libtiffpic/depth/flower-palette-02.tif", true), + ("tests/libtiffpic/depth/flower-palette-04.tif", true), + ("tests/libtiffpic/depth/flower-palette-08.tif", true), + ("tests/libtiffpic/depth/flower-palette-16.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-02.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-04.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-08.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-10.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-12.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-14.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-16.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-24.tif", true), + ("tests/libtiffpic/depth/flower-rgb-contig-32.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-02.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-04.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-08.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-10.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-12.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-14.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-16.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-24.tif", true), + ("tests/libtiffpic/depth/flower-rgb-planar-32.tif", true), + ( + "tests/libtiffpic/depth/flower-separated-contig-08.tif", + true, + ), + ( + "tests/libtiffpic/depth/flower-separated-contig-16.tif", + true, + ), + ( + "tests/libtiffpic/depth/flower-separated-planar-08.tif", + true, + ), + ( + "tests/libtiffpic/depth/flower-separated-planar-16.tif", + true, + ), + ("tests/libtiffpic/depth/genimages", false), + ("tests/libtiffpic/depth/README.txt", false), + ("tests/libtiffpic/depth/summary.txt", false), + ("tests/libtiffpic/dscf0013.tif", true), + ("tests/libtiffpic/fax2d.tif", true), + // No support for direct CCITT Group 3 1D format + ("tests/libtiffpic/g3test.g3", false), + ("tests/libtiffpic/g3test.tif", true), + ("tests/libtiffpic/jello.tif", true), + ("tests/libtiffpic/jim___ah.tif", true), + ("tests/libtiffpic/jim___cg.tif", true), + ("tests/libtiffpic/jim___dg.tif", true), + ("tests/libtiffpic/jim___gg.tif", true), + ("tests/libtiffpic/ladoga.tif", true), + ("tests/libtiffpic/off_l16.tif", true), + ("tests/libtiffpic/off_luv24.tif", true), + ("tests/libtiffpic/off_luv32.tif", true), + ("tests/libtiffpic/oxford.tif", true), + ("tests/libtiffpic/pc260001.tif", true), + ("tests/libtiffpic/quad-jpeg.tif", true), + ("tests/libtiffpic/quad-lzw.tif", true), + // FIXME: See , this has tiles as + // StripOffsets and has a RowsPerStrip. + ("tests/libtiffpic/quad-tile.tif", false), + ("tests/libtiffpic/README", false), + ("tests/libtiffpic/smallliz.tif", true), + ("tests/libtiffpic/strike.tif", true), + ("tests/libtiffpic/text.tif", true), + ("tests/libtiffpic/ycbcr-cat.tif", true), + ("tests/libtiffpic/zackthecat.tif", true), +]; + +fn main() { + let mut candidates: HashMap<_, _> = FILES.iter().copied().collect(); + let mut trials = Vec::new(); + + for entry in WalkDir::new(REFERENCE_DIR) { + let entry = entry.unwrap(); + + if !entry.file_type().is_file() { + continue; + } + + let Some(path) = entry.path().to_str() else { + continue; + }; + + // Mark this path as consumed in either case by removing it. + let Some(should_decode) = candidates.remove(path) else { + panic!("File {} not in reference list", path); + }; + + // Check if we should turn it into a test case. + if !should_decode { + continue; + } + + let path = path.to_string(); + trials.push(Trial::test( + path.to_string(), + move || -> Result<(), Failed> { + decode_libtiffpic(&path) + .map_err(|e| Failed::from(format_args!("Decoding failed for {}: {}", path, e))) + }, + )); + } + + if !candidates.is_empty() { + for (path, _) in candidates { + eprintln!("Reference file {} not found in directory walk", path); + } + + panic!("Some reference files were not found"); + } + + let args = Arguments::from_args(); + libtest_mimic::run(&args, trials).exit(); +} + +fn decode_libtiffpic(path: &str) -> Result<(), tiff::TiffError> { + let path = path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(path); + + let img_file = File::open(path)?; + let mut decoder = Decoder::new(img_file)?; + let mut buffer = DecodingResult::U8(vec![]); + + loop { + let _layout = decoder.read_image_to_buffer(&mut buffer); + + if !decoder.more_images() { + break; + } + + decoder.next_image()?; + } + + Ok(()) +} diff --git a/tests/libtiffpic/CVS/Entries b/tests/libtiffpic/CVS/Entries new file mode 100644 index 0000000..40cd74e --- /dev/null +++ b/tests/libtiffpic/CVS/Entries @@ -0,0 +1,28 @@ +/cramps-tile.tif/1.1/Sat Nov 23 05:17:31 2002/-kb/ +/cramps.tif/1.1/Sat Nov 23 05:17:31 2002/-kb/ +/fax2d.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/g3test.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/jello.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/jim___ah.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/jim___cg.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/jim___dg.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/jim___gg.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/off_l16.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/off_luv24.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/off_luv32.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/oxford.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/quad-jpeg.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/quad-lzw.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/quad-tile.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/smallliz.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/strike.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/text.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +/ycbcr-cat.tif/1.1/Sat Nov 23 05:17:32 2002/-kb/ +D/depth//// +/README/1.2/Thu Dec 29 22:06:14 2005// +/caspian.tif/1.1/Thu Dec 29 22:06:43 2005/-kb/ +/dscf0013.tif/1.1/Thu Dec 29 22:07:23 2005/-kb/ +/g3test.g3/1.1/Thu Dec 29 22:07:27 2005/-kb/ +/ladoga.tif/1.1/Thu Dec 29 22:07:29 2005/-kb/ +/pc260001.tif/1.1/Mon Dec 26 14:54:00 2005/-kb/ +/zackthecat.tif/1.1/Thu Dec 29 22:08:43 2005/-kb/ diff --git a/tests/libtiffpic/CVS/Repository b/tests/libtiffpic/CVS/Repository new file mode 100644 index 0000000..ff4dfe3 --- /dev/null +++ b/tests/libtiffpic/CVS/Repository @@ -0,0 +1 @@ +libtiffpic diff --git a/tests/libtiffpic/CVS/Root b/tests/libtiffpic/CVS/Root new file mode 100644 index 0000000..9f5c5d4 --- /dev/null +++ b/tests/libtiffpic/CVS/Root @@ -0,0 +1 @@ +:pserver:dron@cvs.maptools.org:/cvs/maptools/cvsroot diff --git a/tests/libtiffpic/README b/tests/libtiffpic/README new file mode 100644 index 0000000..5ea0435 --- /dev/null +++ b/tests/libtiffpic/README @@ -0,0 +1,101 @@ +The following image files are included for testing. Note that a wide +variety of images can be generated using the tools provided with the +library (e.g. tiffcp, tiff2bw, tiffmedian, etc.); see below for some +hints on this. + +PlanarConfiguration = 1 (packed data) +------------------------------------- +caspian.tif 279x220 64-bit floating point (deflate) Caspian Sea from space +cramps.tif 800x607 8-bit b&w (packbits) "cramps poster" +cramps-tile.tif 256x256 tiled version of cramps.tif (no compression) +dscf0013.tif 640x480 YCbCr digital camera image which lacks Reference + Black/White values. Contains EXIF SubIFD. No compression. +fax2d.tif 1728x1082 1-bit b&w (G3/2D) facsimile +g3test.g3 raw Group 3 encoded fax file +g3test.tif TIFF equivalent of g3test.g3 created by fax2tiff +jello.tif 256x192 8-bit RGB (lzw palette) Paul Heckbert "jello" +ladoga.tif 158x118 16-bit unsigned, single band, deflate +off_l16.tif 333x225 8-bit CIE LogL (SGILog) office from Greg Larson +off_luv24.tif 333x225 8-bit CIE LogLuv (SGILog24) office from " " +off_luv32.tif 333x225 8-bit CIE LogLuv (SGILog) office from " " +pc260001.tif 640x480 8-bit RGB digital camera image. Contains EXIF SubIFD. + No compression. +quad-jpeg.tif 512x384 8-bit YCbCr (jpeg) version of quad-lzw.tif +quad-lzw.tif 512x384 8-bit RGB (lzw) "quadric surfaces" +quad-tile.tif 512x384 tiled version of quad-lzw.tif (lzw) +strike.tif 256x200 8-bit RGBA (lzw) "bowling pins" from Pixar +text.tif 1512x359 4-bit b&w (thunderscan) am-express credit card +ycbcr-cat.tif 250x325 8-bit YCbCr (lzw) "kitty" created by rgb2ycbcr + +smallliz.tif 160x160 8-bit YCbCr (OLD jpeg) lizard from HP** +zackthecat.tif 234x213 8-bit YCbCr (OLD jpeg) tiled "ZackTheCat" from NeXT** + +** These images are in a deprecated format and are included only for testing + backwards compatibility. JPEG-encoded TIFF images use a different scheme + described in TIFF Technical Note #2 and implemented by libtiff. + +PlanarConfiguration = 2 (separated samples) +------------------------------------------- +oxford.tif 601x81 8-bit RGB (lzw) screendump off oxford + +The other images are from Hewlett Packard and exemplify the use of the +HalftoneHints tag (in their words): + +The images are all the same subject, and should all appear the same +after rendering. Each of the images is slightly different as outlined +by the following table: + + FileName ToneRange HalftoneHints +jim___cg.tif A Y +jim___dg.tif B N +jim___gg.tif B Y + +The images with tone range A are 0-100% linear reflectance images, +in other words, fixed full gamut tone range. The images with tone +range B are what we call "normalized", meaning that the image has +been tone adjusted such the Highlight and Shadow are at gray levels +1 & 2**BitsPerSample-2. + +Each of the three grayscale images should be rendered to look like +the halftone in pics/jim___ah.tif when printed on a Canon SX engine. + +Generated Images +---------------- +The file g3test.tif was created from g3test.g3 with the command: + + fax2tiff -o t.tif -1 -p -M -R 98 g3test.g3 + +Tiled images can be created with tiffcp; e.g. + + tiffcp -t -c none cramps.tif cramps-tile.tif + +(but the tiled images included here were actually generated by the +Silicon Graphics Image Library). + +The file quad-jpeg.tif was created from quad-lzw.tif with the command: + + tiffcp -c jpeg quad-lzw.tif quad-jpeg.tif + +To generate a tiled image with separated samples the following might +be used: + + tiffcp -t -p separate quad-lzw.tif t.tif + +[ Beware that tiffcp does not handle every format TIFF image. In particular, + when conversion between tiled and strip'd images is reliable only when + BitsPerSample is 8. ] + +To generate a G4-encoded image with a single strip the following would work: + + tiffcp -c g4 -r 1082 fax2d.tif t.tif + +Contributing New Images +----------------------- +If you have images that are significantly different from those included +in this package and that do NOT HAVE A COPYRIGHT; feel free to send them +to me at sam@engr.sgi.com. I prefer to receive a URL to a location from +which I can retrieve the image by public FTP. However if that is not +possible you can send it to me in a mail message uuencode'd. Please do +not send large images by mail. Also, please do not send me an image +unless it is notably unique; e.g. not easily generated using the tools +I provide. diff --git a/tests/libtiffpic/caspian.tif b/tests/libtiffpic/caspian.tif new file mode 100644 index 0000000..a907840 Binary files /dev/null and b/tests/libtiffpic/caspian.tif differ diff --git a/tests/libtiffpic/cramps-tile.tif b/tests/libtiffpic/cramps-tile.tif new file mode 100644 index 0000000..d2dec76 Binary files /dev/null and b/tests/libtiffpic/cramps-tile.tif differ diff --git a/tests/libtiffpic/cramps.tif b/tests/libtiffpic/cramps.tif new file mode 100644 index 0000000..b54c572 Binary files /dev/null and b/tests/libtiffpic/cramps.tif differ diff --git a/tests/libtiffpic/depth/CVS/Entries b/tests/libtiffpic/depth/CVS/Entries new file mode 100644 index 0000000..b496d98 --- /dev/null +++ b/tests/libtiffpic/depth/CVS/Entries @@ -0,0 +1,40 @@ +/README.txt/1.1/Sun Jan 30 23:03:00 2005// +/genimages/1.1/Mon Jan 31 02:49:00 2005// +/summary.txt/1.1/Mon Jan 31 02:49:00 2005// +/flower-minisblack-24.tif/1.2/Sun Nov 13 17:25:25 2005/-kb/ +/flower-rgb-contig-24.tif/1.2/Sun Nov 13 17:22:46 2005/-kb/ +/flower-rgb-planar-24.tif/1.2/Sun Nov 13 17:20:24 2005/-kb/ +/flower-minisblack-02.tif/1.1/Thu Dec 29 22:08:43 2005/-kb/ +/flower-minisblack-04.tif/1.1/Thu Dec 29 22:08:43 2005/-kb/ +/flower-minisblack-06.tif/1.1/Thu Dec 29 22:08:43 2005/-kb/ +/flower-minisblack-08.tif/1.1/Thu Dec 29 22:08:44 2005/-kb/ +/flower-minisblack-10.tif/1.1/Thu Dec 29 22:08:44 2005/-kb/ +/flower-minisblack-12.tif/1.1/Thu Dec 29 22:08:45 2005/-kb/ +/flower-minisblack-14.tif/1.1/Thu Dec 29 22:08:45 2005/-kb/ +/flower-minisblack-16.tif/1.1/Thu Dec 29 22:08:46 2005/-kb/ +/flower-minisblack-32.tif/1.1/Thu Dec 29 22:08:47 2005/-kb/ +/flower-palette-02.tif/1.1/Thu Dec 29 22:08:47 2005/-kb/ +/flower-palette-04.tif/1.1/Thu Dec 29 22:08:47 2005/-kb/ +/flower-palette-08.tif/1.1/Thu Dec 29 22:08:47 2005/-kb/ +/flower-palette-16.tif/1.1/Thu Dec 29 22:08:49 2005/-kb/ +/flower-rgb-contig-02.tif/1.1/Thu Dec 29 22:08:49 2005/-kb/ +/flower-rgb-contig-04.tif/1.1/Thu Dec 29 22:08:49 2005/-kb/ +/flower-rgb-contig-08.tif/1.1/Thu Dec 29 22:08:50 2005/-kb/ +/flower-rgb-contig-10.tif/1.1/Thu Dec 29 22:08:51 2005/-kb/ +/flower-rgb-contig-12.tif/1.1/Thu Dec 29 22:08:52 2005/-kb/ +/flower-rgb-contig-14.tif/1.1/Thu Dec 29 22:08:53 2005/-kb/ +/flower-rgb-contig-16.tif/1.1/Thu Dec 29 22:08:55 2005/-kb/ +/flower-rgb-contig-32.tif/1.1/Thu Dec 29 22:08:58 2005/-kb/ +/flower-rgb-planar-02.tif/1.1/Thu Dec 29 22:08:58 2005/-kb/ +/flower-rgb-planar-04.tif/1.1/Thu Dec 29 22:08:58 2005/-kb/ +/flower-rgb-planar-08.tif/1.1/Thu Dec 29 22:08:59 2005/-kb/ +/flower-rgb-planar-10.tif/1.1/Thu Dec 29 22:09:00 2005/-kb/ +/flower-rgb-planar-12.tif/1.1/Thu Dec 29 22:09:02 2005/-kb/ +/flower-rgb-planar-14.tif/1.1/Thu Dec 29 22:09:02 2005/-kb/ +/flower-rgb-planar-16.tif/1.1/Thu Dec 29 22:09:04 2005/-kb/ +/flower-rgb-planar-32.tif/1.1/Thu Dec 29 22:09:08 2005/-kb/ +/flower-separated-contig-08.tif/1.1/Thu Dec 29 22:09:10 2005/-kb/ +/flower-separated-contig-16.tif/1.1/Thu Dec 29 22:09:12 2005/-kb/ +/flower-separated-planar-08.tif/1.1/Thu Dec 29 22:09:12 2005/-kb/ +/flower-separated-planar-16.tif/1.1/Thu Dec 29 22:09:14 2005/-kb/ +D diff --git a/tests/libtiffpic/depth/CVS/Repository b/tests/libtiffpic/depth/CVS/Repository new file mode 100644 index 0000000..6288864 --- /dev/null +++ b/tests/libtiffpic/depth/CVS/Repository @@ -0,0 +1 @@ +libtiffpic/depth diff --git a/tests/libtiffpic/depth/CVS/Root b/tests/libtiffpic/depth/CVS/Root new file mode 100644 index 0000000..9f5c5d4 --- /dev/null +++ b/tests/libtiffpic/depth/CVS/Root @@ -0,0 +1 @@ +:pserver:dron@cvs.maptools.org:/cvs/maptools/cvsroot diff --git a/tests/libtiffpic/depth/README.txt b/tests/libtiffpic/depth/README.txt new file mode 100644 index 0000000..dd74611 --- /dev/null +++ b/tests/libtiffpic/depth/README.txt @@ -0,0 +1,9 @@ +These sample TIFF image files are prepared by Bob Friesenhahn + using a development version of +GraphicsMagick 1.2. + +See the file summary.txt for a description of the images. + +These files are hereby placed in the public domain. + + diff --git a/tests/libtiffpic/depth/flower-minisblack-02.tif b/tests/libtiffpic/depth/flower-minisblack-02.tif new file mode 100644 index 0000000..2278aff Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-02.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-04.tif b/tests/libtiffpic/depth/flower-minisblack-04.tif new file mode 100644 index 0000000..2583c42 Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-04.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-06.tif b/tests/libtiffpic/depth/flower-minisblack-06.tif new file mode 100644 index 0000000..a9c0c3d Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-06.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-08.tif b/tests/libtiffpic/depth/flower-minisblack-08.tif new file mode 100644 index 0000000..f7d8340 Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-08.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-10.tif b/tests/libtiffpic/depth/flower-minisblack-10.tif new file mode 100644 index 0000000..d93960c Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-10.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-12.tif b/tests/libtiffpic/depth/flower-minisblack-12.tif new file mode 100644 index 0000000..1673be8 Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-12.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-14.tif b/tests/libtiffpic/depth/flower-minisblack-14.tif new file mode 100644 index 0000000..1d53867 Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-14.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-16.tif b/tests/libtiffpic/depth/flower-minisblack-16.tif new file mode 100644 index 0000000..3c2a6dd Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-16.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-24.tif b/tests/libtiffpic/depth/flower-minisblack-24.tif new file mode 100644 index 0000000..5035df4 Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-24.tif differ diff --git a/tests/libtiffpic/depth/flower-minisblack-32.tif b/tests/libtiffpic/depth/flower-minisblack-32.tif new file mode 100644 index 0000000..36d48d4 Binary files /dev/null and b/tests/libtiffpic/depth/flower-minisblack-32.tif differ diff --git a/tests/libtiffpic/depth/flower-palette-02.tif b/tests/libtiffpic/depth/flower-palette-02.tif new file mode 100644 index 0000000..6bd445d Binary files /dev/null and b/tests/libtiffpic/depth/flower-palette-02.tif differ diff --git a/tests/libtiffpic/depth/flower-palette-04.tif b/tests/libtiffpic/depth/flower-palette-04.tif new file mode 100644 index 0000000..b50ac8c Binary files /dev/null and b/tests/libtiffpic/depth/flower-palette-04.tif differ diff --git a/tests/libtiffpic/depth/flower-palette-08.tif b/tests/libtiffpic/depth/flower-palette-08.tif new file mode 100644 index 0000000..b778037 Binary files /dev/null and b/tests/libtiffpic/depth/flower-palette-08.tif differ diff --git a/tests/libtiffpic/depth/flower-palette-16.tif b/tests/libtiffpic/depth/flower-palette-16.tif new file mode 100644 index 0000000..cf3de60 Binary files /dev/null and b/tests/libtiffpic/depth/flower-palette-16.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-02.tif b/tests/libtiffpic/depth/flower-rgb-contig-02.tif new file mode 100644 index 0000000..3813313 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-02.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-04.tif b/tests/libtiffpic/depth/flower-rgb-contig-04.tif new file mode 100644 index 0000000..b469f94 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-04.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-08.tif b/tests/libtiffpic/depth/flower-rgb-contig-08.tif new file mode 100644 index 0000000..2ea0944 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-08.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-10.tif b/tests/libtiffpic/depth/flower-rgb-contig-10.tif new file mode 100644 index 0000000..b6a2240 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-10.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-12.tif b/tests/libtiffpic/depth/flower-rgb-contig-12.tif new file mode 100644 index 0000000..2048573 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-12.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-14.tif b/tests/libtiffpic/depth/flower-rgb-contig-14.tif new file mode 100644 index 0000000..c9e27c0 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-14.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-16.tif b/tests/libtiffpic/depth/flower-rgb-contig-16.tif new file mode 100644 index 0000000..869fe05 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-16.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-24.tif b/tests/libtiffpic/depth/flower-rgb-contig-24.tif new file mode 100644 index 0000000..6037f52 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-24.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-contig-32.tif b/tests/libtiffpic/depth/flower-rgb-contig-32.tif new file mode 100644 index 0000000..17875ee Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-contig-32.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-02.tif b/tests/libtiffpic/depth/flower-rgb-planar-02.tif new file mode 100644 index 0000000..afd364c Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-02.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-04.tif b/tests/libtiffpic/depth/flower-rgb-planar-04.tif new file mode 100644 index 0000000..ec97dc3 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-04.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-08.tif b/tests/libtiffpic/depth/flower-rgb-planar-08.tif new file mode 100644 index 0000000..bbe287f Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-08.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-10.tif b/tests/libtiffpic/depth/flower-rgb-planar-10.tif new file mode 100644 index 0000000..9d21bbe Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-10.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-12.tif b/tests/libtiffpic/depth/flower-rgb-planar-12.tif new file mode 100644 index 0000000..34a3944 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-12.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-14.tif b/tests/libtiffpic/depth/flower-rgb-planar-14.tif new file mode 100644 index 0000000..2c69002 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-14.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-16.tif b/tests/libtiffpic/depth/flower-rgb-planar-16.tif new file mode 100644 index 0000000..9356666 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-16.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-24.tif b/tests/libtiffpic/depth/flower-rgb-planar-24.tif new file mode 100644 index 0000000..e9365d1 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-24.tif differ diff --git a/tests/libtiffpic/depth/flower-rgb-planar-32.tif b/tests/libtiffpic/depth/flower-rgb-planar-32.tif new file mode 100644 index 0000000..fa10e31 Binary files /dev/null and b/tests/libtiffpic/depth/flower-rgb-planar-32.tif differ diff --git a/tests/libtiffpic/depth/flower-separated-contig-08.tif b/tests/libtiffpic/depth/flower-separated-contig-08.tif new file mode 100644 index 0000000..7eefd53 Binary files /dev/null and b/tests/libtiffpic/depth/flower-separated-contig-08.tif differ diff --git a/tests/libtiffpic/depth/flower-separated-contig-16.tif b/tests/libtiffpic/depth/flower-separated-contig-16.tif new file mode 100644 index 0000000..5df4246 Binary files /dev/null and b/tests/libtiffpic/depth/flower-separated-contig-16.tif differ diff --git a/tests/libtiffpic/depth/flower-separated-planar-08.tif b/tests/libtiffpic/depth/flower-separated-planar-08.tif new file mode 100644 index 0000000..6994a12 Binary files /dev/null and b/tests/libtiffpic/depth/flower-separated-planar-08.tif differ diff --git a/tests/libtiffpic/depth/flower-separated-planar-16.tif b/tests/libtiffpic/depth/flower-separated-planar-16.tif new file mode 100644 index 0000000..380b9b4 Binary files /dev/null and b/tests/libtiffpic/depth/flower-separated-planar-16.tif differ diff --git a/tests/libtiffpic/depth/genimages b/tests/libtiffpic/depth/genimages new file mode 100755 index 0000000..d43dd11 --- /dev/null +++ b/tests/libtiffpic/depth/genimages @@ -0,0 +1,73 @@ +#!/usr/bin/ksh + +GM=/scratch/bfriesen/build/GraphicsMagick-32-static/utilities/gm +GM_STD_OPT="-compress none" +MASTER_IMAGE_ORIGINAL='/home/bfriesen/images/david/112_1201-flowers.jpg' +MASTER_IMAGE_GRAY=gray.miff +MASTER_IMAGE_RGB=rgb.miff +MASTER_IMAGE_CMYK=cmyk.miff +COLUMNS=73 +ROWS=43 + +GRAY_DEPTHS='2 4 6 8 10 12 14 16 24 32' +PSEUDO_DEPTHS='2 4 8 16' +TRUE_COLORS='2 4 8 10 12 14 16 24 32' +CMYK_COLORS='8 16' + +SUMMARY=summary.txt +echo > $SUMMARY + +$GM convert $MASTER_IMAGE_ORIGINAL +profile '*' -depth 32 -type Grayscale -density 72x72 -geometry "${COLUMNS}x${ROWS}" $MASTER_IMAGE_GRAY +$GM convert $MASTER_IMAGE_ORIGINAL +profile '*' -depth 32 -density 72x72 -geometry "${COLUMNS}x${ROWS}" $MASTER_IMAGE_RGB +$GM convert $MASTER_IMAGE_ORIGINAL +profile '*' -colorspace cmyk -depth 32 -density 72x72 -geometry "${COLUMNS}x${ROWS}" $MASTER_IMAGE_CMYK + +# Gray images +for depth in $GRAY_DEPTHS +do + outname=`printf "flower-minisblack-%02d.tif" $depth` + echo "$outname\t${COLUMNS}x${ROWS} $depth-bit minisblack gray image" >> $SUMMARY + $GM convert -verbose $MASTER_IMAGE_GRAY $GM_STD_OPT -type Grayscale -define tiff:bits-per-sample=$depth $outname +done + +# Colormapped images +for depth in $PSEUDO_DEPTHS +do + colors=`echo "2^${depth}" | bc` + outname=`printf "flower-palette-%02d.tif" $depth` + echo "$outname\t${COLUMNS}x${ROWS} ${colors}-entry colormapped image" >> $SUMMARY + $GM convert -verbose $MASTER_IMAGE_RGB $GM_STD_OPT -colors $colors $outname +done + +# Truecolor images +for depth in $TRUE_COLORS +do + outname=`printf "flower-rgb-contig-%02d.tif" $depth` + echo "$outname\t${COLUMNS}x${ROWS} $depth-bit contiguous RGB image" >> $SUMMARY + $GM convert -verbose $MASTER_IMAGE_RGB $GM_STD_OPT -type TrueColor -define tiff:bits-per-sample=$depth $outname +done + +# Truecolor planar images +for depth in $TRUE_COLORS +do + outname=`printf "flower-rgb-planar-%02d.tif" $depth` + echo "$outname\t${COLUMNS}x${ROWS} $depth-bit seperated RGB image" >> $SUMMARY + $GM convert -verbose $MASTER_IMAGE_RGB $GM_STD_OPT -type TrueColor -interlace plane -define tiff:bits-per-sample=$depth $outname +done + +# CMYK images +for depth in $CMYK_COLORS +do + outname=`printf "flower-separated-contig-%02d.tif" $depth` + echo "$outname\t${COLUMNS}x${ROWS} $depth-bit contiguous CMYK image" >> $SUMMARY + $GM convert -verbose $MASTER_IMAGE_RGB $GM_STD_OPT -type ColorSeparation -define tiff:bits-per-sample=$depth $outname +done + +# CMYK planar images +for depth in $CMYK_COLORS +do + outname=`printf "flower-separated-planar-%02d.tif" $depth` + echo "$outname\t${COLUMNS}x${ROWS} $depth-bit separated CMYK image" >> $SUMMARY + $GM convert -verbose $MASTER_IMAGE_RGB $GM_STD_OPT -type ColorSeparation -interlace plane -define tiff:bits-per-sample=$depth $outname +done + +rm -f $MASTER_IMAGE_GRAY $MASTER_IMAGE_RGB $MASTER_IMAGE_CMYK \ No newline at end of file diff --git a/tests/libtiffpic/depth/summary.txt b/tests/libtiffpic/depth/summary.txt new file mode 100644 index 0000000..19f3aab --- /dev/null +++ b/tests/libtiffpic/depth/summary.txt @@ -0,0 +1,37 @@ + +flower-minisblack-02.tif 73x43 2-bit minisblack gray image +flower-minisblack-04.tif 73x43 4-bit minisblack gray image +flower-minisblack-06.tif 73x43 6-bit minisblack gray image +flower-minisblack-08.tif 73x43 8-bit minisblack gray image +flower-minisblack-10.tif 73x43 10-bit minisblack gray image +flower-minisblack-12.tif 73x43 12-bit minisblack gray image +flower-minisblack-14.tif 73x43 14-bit minisblack gray image +flower-minisblack-16.tif 73x43 16-bit minisblack gray image +flower-minisblack-24.tif 73x43 24-bit minisblack gray image +flower-minisblack-32.tif 73x43 32-bit minisblack gray image +flower-palette-02.tif 73x43 4-entry colormapped image +flower-palette-04.tif 73x43 16-entry colormapped image +flower-palette-08.tif 73x43 256-entry colormapped image +flower-palette-16.tif 73x43 65536-entry colormapped image +flower-rgb-contig-02.tif 73x43 2-bit contiguous RGB image +flower-rgb-contig-04.tif 73x43 4-bit contiguous RGB image +flower-rgb-contig-08.tif 73x43 8-bit contiguous RGB image +flower-rgb-contig-10.tif 73x43 10-bit contiguous RGB image +flower-rgb-contig-12.tif 73x43 12-bit contiguous RGB image +flower-rgb-contig-14.tif 73x43 14-bit contiguous RGB image +flower-rgb-contig-16.tif 73x43 16-bit contiguous RGB image +flower-rgb-contig-24.tif 73x43 24-bit contiguous RGB image +flower-rgb-contig-32.tif 73x43 32-bit contiguous RGB image +flower-rgb-planar-02.tif 73x43 2-bit seperated RGB image +flower-rgb-planar-04.tif 73x43 4-bit seperated RGB image +flower-rgb-planar-08.tif 73x43 8-bit seperated RGB image +flower-rgb-planar-10.tif 73x43 10-bit seperated RGB image +flower-rgb-planar-12.tif 73x43 12-bit seperated RGB image +flower-rgb-planar-14.tif 73x43 14-bit seperated RGB image +flower-rgb-planar-16.tif 73x43 16-bit seperated RGB image +flower-rgb-planar-24.tif 73x43 24-bit seperated RGB image +flower-rgb-planar-32.tif 73x43 32-bit seperated RGB image +flower-separated-contig-08.tif 73x43 8-bit contiguous CMYK image +flower-separated-contig-16.tif 73x43 16-bit contiguous CMYK image +flower-separated-planar-08.tif 73x43 8-bit separated CMYK image +flower-separated-planar-16.tif 73x43 16-bit separated CMYK image diff --git a/tests/libtiffpic/dscf0013.tif b/tests/libtiffpic/dscf0013.tif new file mode 100644 index 0000000..4c4792c Binary files /dev/null and b/tests/libtiffpic/dscf0013.tif differ diff --git a/tests/libtiffpic/fax2d.tif b/tests/libtiffpic/fax2d.tif new file mode 100644 index 0000000..ce38c00 Binary files /dev/null and b/tests/libtiffpic/fax2d.tif differ diff --git a/tests/libtiffpic/g3test.g3 b/tests/libtiffpic/g3test.g3 new file mode 100644 index 0000000..9382efe Binary files /dev/null and b/tests/libtiffpic/g3test.g3 differ diff --git a/tests/libtiffpic/g3test.tif b/tests/libtiffpic/g3test.tif new file mode 100644 index 0000000..2a8eb1e Binary files /dev/null and b/tests/libtiffpic/g3test.tif differ diff --git a/tests/libtiffpic/jello.tif b/tests/libtiffpic/jello.tif new file mode 100644 index 0000000..535ad05 Binary files /dev/null and b/tests/libtiffpic/jello.tif differ diff --git a/tests/libtiffpic/jim___ah.tif b/tests/libtiffpic/jim___ah.tif new file mode 100644 index 0000000..21a897d Binary files /dev/null and b/tests/libtiffpic/jim___ah.tif differ diff --git a/tests/libtiffpic/jim___cg.tif b/tests/libtiffpic/jim___cg.tif new file mode 100644 index 0000000..447df0f Binary files /dev/null and b/tests/libtiffpic/jim___cg.tif differ diff --git a/tests/libtiffpic/jim___dg.tif b/tests/libtiffpic/jim___dg.tif new file mode 100644 index 0000000..856811f Binary files /dev/null and b/tests/libtiffpic/jim___dg.tif differ diff --git a/tests/libtiffpic/jim___gg.tif b/tests/libtiffpic/jim___gg.tif new file mode 100644 index 0000000..d660f43 Binary files /dev/null and b/tests/libtiffpic/jim___gg.tif differ diff --git a/tests/libtiffpic/ladoga.tif b/tests/libtiffpic/ladoga.tif new file mode 100644 index 0000000..e44f8c0 Binary files /dev/null and b/tests/libtiffpic/ladoga.tif differ diff --git a/tests/libtiffpic/off_l16.tif b/tests/libtiffpic/off_l16.tif new file mode 100644 index 0000000..730d10f Binary files /dev/null and b/tests/libtiffpic/off_l16.tif differ diff --git a/tests/libtiffpic/off_luv24.tif b/tests/libtiffpic/off_luv24.tif new file mode 100644 index 0000000..48c7721 Binary files /dev/null and b/tests/libtiffpic/off_luv24.tif differ diff --git a/tests/libtiffpic/off_luv32.tif b/tests/libtiffpic/off_luv32.tif new file mode 100644 index 0000000..ddf4924 Binary files /dev/null and b/tests/libtiffpic/off_luv32.tif differ diff --git a/tests/libtiffpic/oxford.tif b/tests/libtiffpic/oxford.tif new file mode 100644 index 0000000..7ec417b Binary files /dev/null and b/tests/libtiffpic/oxford.tif differ diff --git a/tests/libtiffpic/pc260001.tif b/tests/libtiffpic/pc260001.tif new file mode 100644 index 0000000..05b97ad Binary files /dev/null and b/tests/libtiffpic/pc260001.tif differ diff --git a/tests/libtiffpic/quad-jpeg.tif b/tests/libtiffpic/quad-jpeg.tif new file mode 100644 index 0000000..e14f4c2 Binary files /dev/null and b/tests/libtiffpic/quad-jpeg.tif differ diff --git a/tests/libtiffpic/quad-lzw.tif b/tests/libtiffpic/quad-lzw.tif new file mode 100644 index 0000000..ec614bf Binary files /dev/null and b/tests/libtiffpic/quad-lzw.tif differ diff --git a/tests/libtiffpic/quad-tile.tif b/tests/libtiffpic/quad-tile.tif new file mode 100644 index 0000000..4ed11dd Binary files /dev/null and b/tests/libtiffpic/quad-tile.tif differ diff --git a/tests/libtiffpic/smallliz.tif b/tests/libtiffpic/smallliz.tif new file mode 100755 index 0000000..ee9dbb0 Binary files /dev/null and b/tests/libtiffpic/smallliz.tif differ diff --git a/tests/libtiffpic/strike.tif b/tests/libtiffpic/strike.tif new file mode 100644 index 0000000..21bc748 Binary files /dev/null and b/tests/libtiffpic/strike.tif differ diff --git a/tests/libtiffpic/text.tif b/tests/libtiffpic/text.tif new file mode 100644 index 0000000..4f5206d Binary files /dev/null and b/tests/libtiffpic/text.tif differ diff --git a/tests/libtiffpic/ycbcr-cat.tif b/tests/libtiffpic/ycbcr-cat.tif new file mode 100644 index 0000000..445e6ac Binary files /dev/null and b/tests/libtiffpic/ycbcr-cat.tif differ diff --git a/tests/libtiffpic/zackthecat.tif b/tests/libtiffpic/zackthecat.tif new file mode 100644 index 0000000..15185b6 Binary files /dev/null and b/tests/libtiffpic/zackthecat.tif differ