|
roentgen |
b75cab |
# Tag Image File Format (TIFF) Software
|
|
roentgen |
b75cab |
#
|
|
roentgen |
b75cab |
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu></dron@ak4719.spb.edu>
|
|
roentgen |
b75cab |
#
|
|
roentgen |
b75cab |
# Permission to use, copy, modify, distribute, and sell this software and
|
|
roentgen |
b75cab |
# its documentation for any purpose is hereby granted without fee, provided
|
|
roentgen |
b75cab |
# that (i) the above copyright notices and this permission notice appear in
|
|
roentgen |
b75cab |
# all copies of the software and related documentation, and (ii) the names of
|
|
roentgen |
b75cab |
# Sam Leffler and Silicon Graphics may not be used in any advertising or
|
|
roentgen |
b75cab |
# publicity relating to the software without the specific, prior written
|
|
roentgen |
b75cab |
# permission of Sam Leffler and Silicon Graphics.
|
|
roentgen |
b75cab |
#
|
|
roentgen |
b75cab |
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
|
roentgen |
b75cab |
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
|
roentgen |
b75cab |
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
roentgen |
b75cab |
#
|
|
roentgen |
b75cab |
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
|
roentgen |
b75cab |
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
|
roentgen |
b75cab |
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
roentgen |
b75cab |
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
|
roentgen |
b75cab |
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
|
roentgen |
b75cab |
# OF THIS SOFTWARE.
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Process this file with automake to produce Makefile.in.
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
AUTOMAKE_OPTIONS = 1.12 color-tests parallel-tests foreign
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Environment parameters to be used during tests
|
|
roentgen |
b75cab |
TESTS_ENVIRONMENT = \
|
|
roentgen |
b75cab |
MAKE="$(MAKE)" \
|
|
roentgen |
b75cab |
MAKEFLAGS="$(MAKEFLAGS)" \
|
|
roentgen |
b75cab |
MEMCHECK="$(MEMCHECK)"
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
EXTRA_DIST = \
|
|
roentgen |
b75cab |
$(TESTSCRIPTS) \
|
|
roentgen |
b75cab |
$(IMAGES_EXTRA_DIST) \
|
|
roentgen |
b75cab |
common.sh
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# All of the tests to execute via 'make check'
|
|
roentgen |
b75cab |
TESTS = $(check_PROGRAMS) $(TESTSCRIPTS)
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Tests which are expected to fail
|
|
roentgen |
b75cab |
XFAIL_TESTS =
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Extra files which should be cleaned by 'make clean'
|
|
roentgen |
b75cab |
CLEANFILES = test_packbits.tif o-*
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Executable programs which need to be built in order to support tests
|
|
roentgen |
b75cab |
check_PROGRAMS = ascii_tag long_tag short_tag strip_rw rewrite raw_decode custom_dir
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Test scripts to execute
|
|
roentgen |
b75cab |
TESTSCRIPTS = \
|
|
roentgen |
b75cab |
bmp2tiff_palette.sh \
|
|
roentgen |
b75cab |
bmp2tiff_rgb.sh \
|
|
roentgen |
b75cab |
gif2tiff.sh \
|
|
roentgen |
b75cab |
ppm2tiff_pbm.sh \
|
|
roentgen |
b75cab |
ppm2tiff_pgm.sh \
|
|
roentgen |
b75cab |
ppm2tiff_ppm.sh \
|
|
roentgen |
b75cab |
tiffcp-g3.sh \
|
|
roentgen |
b75cab |
tiffcp-g3-1d.sh \
|
|
roentgen |
b75cab |
tiffcp-g3-1d-fill.sh \
|
|
roentgen |
b75cab |
tiffcp-g3-2d.sh \
|
|
roentgen |
b75cab |
tiffcp-g3-2d-fill.sh \
|
|
roentgen |
b75cab |
tiffcp-g4.sh \
|
|
roentgen |
b75cab |
tiffcp-logluv.sh \
|
|
roentgen |
b75cab |
tiffcp-thumbnail.sh \
|
|
roentgen |
b75cab |
tiffdump.sh \
|
|
roentgen |
b75cab |
tiffinfo.sh \
|
|
roentgen |
b75cab |
tiffcp-split.sh \
|
|
roentgen |
b75cab |
tiffcp-split-join.sh \
|
|
roentgen |
b75cab |
tiff2ps-PS1.sh \
|
|
roentgen |
b75cab |
tiff2ps-PS2.sh \
|
|
roentgen |
b75cab |
tiff2ps-PS3.sh \
|
|
roentgen |
b75cab |
tiff2ps-EPS1.sh \
|
|
roentgen |
b75cab |
tiff2pdf.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-logluv-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-minisblack-1c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-minisblack-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-miniswhite-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-palette-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-palette-1c-4b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-palette-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-rgb-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-doubleflip-rgb-3c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-logluv-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-minisblack-1c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-minisblack-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-minisblack-2c-8b-alpha.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-miniswhite-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-palette-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-palette-1c-4b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-palette-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-rgb-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extract-rgb-3c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-logluv-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-minisblack-1c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-minisblack-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-minisblack-2c-8b-alpha.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-miniswhite-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-palette-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-palette-1c-4b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-palette-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-rgb-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-extractz14-rgb-3c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-logluv-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-minisblack-1c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-minisblack-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-minisblack-2c-8b-alpha.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-miniswhite-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-palette-1c-1b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-palette-1c-4b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-palette-1c-8b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-rgb-3c-16b.sh \
|
|
roentgen |
b75cab |
tiffcrop-R90-rgb-3c-8b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-logluv-3c-16b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-minisblack-1c-16b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-minisblack-1c-8b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-minisblack-2c-8b-alpha.sh \
|
|
roentgen |
b75cab |
tiff2rgba-miniswhite-1c-1b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-palette-1c-1b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-palette-1c-4b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-palette-1c-8b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-rgb-3c-16b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-rgb-3c-8b.sh \
|
|
roentgen |
b75cab |
tiff2rgba-quad-tile.jpg.sh
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# This list should contain all of the TIFF files in the 'images'
|
|
roentgen |
b75cab |
# subdirectory which are intended to be used as input images for
|
|
roentgen |
b75cab |
# tests. All of these files should use the extension ".tiff".
|
|
roentgen |
b75cab |
TIFFIMAGES = \
|
|
roentgen |
b75cab |
images/logluv-3c-16b.tiff \
|
|
roentgen |
b75cab |
images/minisblack-1c-16b.tiff \
|
|
roentgen |
b75cab |
images/minisblack-1c-8b.tiff \
|
|
roentgen |
b75cab |
images/minisblack-2c-8b-alpha.tiff \
|
|
roentgen |
b75cab |
images/miniswhite-1c-1b.tiff \
|
|
roentgen |
b75cab |
images/palette-1c-1b.tiff \
|
|
roentgen |
b75cab |
images/palette-1c-4b.tiff \
|
|
roentgen |
b75cab |
images/palette-1c-8b.tiff \
|
|
roentgen |
b75cab |
images/rgb-3c-16b.tiff \
|
|
roentgen |
b75cab |
images/rgb-3c-8b.tiff \
|
|
roentgen |
b75cab |
images/quad-tile.jpg.tiff
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
BMPIMAGES = \
|
|
roentgen |
b75cab |
images/palette-1c-8b.bmp \
|
|
roentgen |
b75cab |
images/rgb-3c-8b.bmp
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
GIFIMAGES = \
|
|
roentgen |
b75cab |
images/palette-1c-8b.gif
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
PNMIMAGES = \
|
|
roentgen |
b75cab |
images/minisblack-1c-8b.pgm \
|
|
roentgen |
b75cab |
images/miniswhite-1c-1b.pbm \
|
|
roentgen |
b75cab |
images/rgb-3c-8b.ppm
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# This list should include all of the files in the 'images'
|
|
roentgen |
b75cab |
# subdirectory which are intended to be distributed. This may include
|
|
roentgen |
b75cab |
# files which are not currently used by the tests.
|
|
roentgen |
b75cab |
IMAGES_EXTRA_DIST = \
|
|
roentgen |
b75cab |
images/README.txt \
|
|
roentgen |
b75cab |
$(BMPIMAGES) \
|
|
roentgen |
b75cab |
$(GIFIMAGES) \
|
|
roentgen |
b75cab |
$(PNMIMAGES) \
|
|
roentgen |
b75cab |
$(TIFFIMAGES)
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
noinst_HEADERS = tifftest.h
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
ascii_tag_SOURCES = ascii_tag.c
|
|
roentgen |
b75cab |
ascii_tag_LDADD = $(LIBTIFF)
|
|
roentgen |
b75cab |
long_tag_SOURCES = long_tag.c check_tag.c
|
|
roentgen |
b75cab |
long_tag_LDADD = $(LIBTIFF)
|
|
roentgen |
b75cab |
short_tag_SOURCES = short_tag.c check_tag.c
|
|
roentgen |
b75cab |
short_tag_LDADD = $(LIBTIFF)
|
|
roentgen |
b75cab |
strip_rw_SOURCES = strip_rw.c strip.c test_arrays.c test_arrays.h
|
|
roentgen |
b75cab |
strip_rw_LDADD = $(LIBTIFF)
|
|
roentgen |
b75cab |
rewrite_SOURCES = rewrite_tag.c
|
|
roentgen |
b75cab |
rewrite_LDADD = $(LIBTIFF)
|
|
roentgen |
b75cab |
raw_decode_SOURCES = raw_decode.c
|
|
roentgen |
b75cab |
raw_decode_LDADD = $(LIBTIFF)
|
|
roentgen |
b75cab |
custom_dir_SOURCES = custom_dir.c
|
|
roentgen |
b75cab |
custom_dir_LDADD = $(LIBTIFF)
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
AM_CPPFLAGS = -I$(top_srcdir)/libtiff
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# memcheck: valgrind's memory access checker
|
|
roentgen |
b75cab |
memcheck:
|
|
roentgen |
b75cab |
$(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes --track-origins=yes --num-callers=12 --quiet $(VALGRIND_EXTRA_OPTS)' check
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# ptrcheck: valgrind's experimental pointer checking tool.
|
|
roentgen |
b75cab |
ptrcheck:
|
|
roentgen |
b75cab |
$(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
generate-tiff2rgba-tests:
|
|
roentgen |
b75cab |
for file in $(TIFFIMAGES) ; \
|
|
roentgen |
b75cab |
do \
|
|
roentgen |
b75cab |
base=`basename $$file .tiff` ; \
|
|
roentgen |
b75cab |
testscript=$(srcdir)/tiff2rgba-$$base.sh ; \
|
|
roentgen |
b75cab |
( \
|
|
roentgen |
b75cab |
echo "#!/bin/sh" ; \
|
|
roentgen |
b75cab |
echo "# Generated file, master is Makefile.am" ; \
|
|
roentgen |
b75cab |
echo ". \$${srcdir:-.}/common.sh" ; \
|
|
roentgen |
b75cab |
echo "infile=\"\$$srcdir/$$file\"" ; \
|
|
roentgen |
b75cab |
echo "outfile=\"o-tiff2rgba-$$base.tiff\"" ; \
|
|
roentgen |
b75cab |
echo "f_test_convert \"\$$TIFF2RGBA\" \$$infile \$$outfile" ; \
|
|
roentgen |
b75cab |
echo "f_tiffinfo_validate \$$outfile" ; \
|
|
roentgen |
b75cab |
) > $$testscript ; \
|
|
roentgen |
b75cab |
chmod +x $$testscript ; \
|
|
roentgen |
b75cab |
done
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Test rotations
|
|
roentgen |
b75cab |
generate-tiffcrop-R90-tests:
|
|
roentgen |
b75cab |
for file in $(TIFFIMAGES) ; \
|
|
roentgen |
b75cab |
do \
|
|
roentgen |
b75cab |
base=`basename $$file .tiff` ; \
|
|
roentgen |
b75cab |
testscript=$(srcdir)/tiffcrop-R90-$$base.sh ; \
|
|
roentgen |
b75cab |
( \
|
|
roentgen |
b75cab |
echo "#!/bin/sh" ; \
|
|
roentgen |
b75cab |
echo "# Generated file, master is Makefile.am" ; \
|
|
roentgen |
b75cab |
echo ". \$${srcdir:-.}/common.sh" ; \
|
|
roentgen |
b75cab |
echo "infile=\"\$$srcdir/$$file\"" ; \
|
|
roentgen |
b75cab |
echo "outfile=\"o-tiffcrop-R90-$$base.tiff\"" ; \
|
|
roentgen |
b75cab |
echo "f_test_convert \"\$$TIFFCROP -R90\" \$$infile \$$outfile" ; \
|
|
roentgen |
b75cab |
echo "f_tiffinfo_validate \$$outfile" ; \
|
|
roentgen |
b75cab |
) > $$testscript ; \
|
|
roentgen |
b75cab |
chmod +x $$testscript ; \
|
|
roentgen |
b75cab |
done
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Test flip (mirror)
|
|
roentgen |
b75cab |
generate-tiffcrop-doubleflip-tests:
|
|
roentgen |
b75cab |
for file in $(TIFFIMAGES) ; \
|
|
roentgen |
b75cab |
do \
|
|
roentgen |
b75cab |
base=`basename $$file .tiff` ; \
|
|
roentgen |
b75cab |
testscript=$(srcdir)/tiffcrop-doubleflip-$$base.sh ; \
|
|
roentgen |
b75cab |
( \
|
|
roentgen |
b75cab |
echo "#!/bin/sh" ; \
|
|
roentgen |
b75cab |
echo "# Generated file, master is Makefile.am" ; \
|
|
roentgen |
b75cab |
echo ". \$${srcdir:-.}/common.sh" ; \
|
|
roentgen |
b75cab |
echo "infile=\"\$$srcdir/$$file\"" ; \
|
|
roentgen |
b75cab |
echo "outfile=\"o-tiffcrop-doubleflip-$$base.tiff\"" ; \
|
|
roentgen |
b75cab |
echo "f_test_convert \"\$$TIFFCROP -F both\" \$$infile \$$outfile" ; \
|
|
roentgen |
b75cab |
echo "f_tiffinfo_validate \$$outfile" ; \
|
|
roentgen |
b75cab |
) > $$testscript ; \
|
|
roentgen |
b75cab |
chmod +x $$testscript ; \
|
|
roentgen |
b75cab |
done
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Test extracting a section 100 pixels wide and 100 pixels high
|
|
roentgen |
b75cab |
generate-tiffcrop-extract-tests:
|
|
roentgen |
b75cab |
for file in $(TIFFIMAGES) ; \
|
|
roentgen |
b75cab |
do \
|
|
roentgen |
b75cab |
base=`basename $$file .tiff` ; \
|
|
roentgen |
b75cab |
testscript=$(srcdir)/tiffcrop-extract-$$base.sh ; \
|
|
roentgen |
b75cab |
( \
|
|
roentgen |
b75cab |
echo "#!/bin/sh" ; \
|
|
roentgen |
b75cab |
echo "# Generated file, master is Makefile.am" ; \
|
|
roentgen |
b75cab |
echo ". \$${srcdir:-.}/common.sh" ; \
|
|
roentgen |
b75cab |
echo "infile=\"\$$srcdir/$$file\"" ; \
|
|
roentgen |
b75cab |
echo "outfile=\"o-tiffcrop-extract-$$base.tiff\"" ; \
|
|
roentgen |
b75cab |
echo "f_test_convert \"\$$TIFFCROP -U px -E top -X 60 -Y 60\" \$$infile \$$outfile" ; \
|
|
roentgen |
b75cab |
echo "f_tiffinfo_validate \$$outfile" ; \
|
|
roentgen |
b75cab |
) > $$testscript ; \
|
|
roentgen |
b75cab |
chmod +x $$testscript ; \
|
|
roentgen |
b75cab |
done
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
# Test extracting the first and fourth quarters from the left side.
|
|
roentgen |
b75cab |
generate-tiffcrop-extractz14-tests:
|
|
roentgen |
b75cab |
for file in $(TIFFIMAGES) ; \
|
|
roentgen |
b75cab |
do \
|
|
roentgen |
b75cab |
base=`basename $$file .tiff` ; \
|
|
roentgen |
b75cab |
testscript=$(srcdir)/tiffcrop-extractz14-$$base.sh ; \
|
|
roentgen |
b75cab |
( \
|
|
roentgen |
b75cab |
echo "#!/bin/sh" ; \
|
|
roentgen |
b75cab |
echo "# Generated file, master is Makefile.am" ; \
|
|
roentgen |
b75cab |
echo ". \$${srcdir:-.}/common.sh" ; \
|
|
roentgen |
b75cab |
echo "infile=\"\$$srcdir/$$file\"" ; \
|
|
roentgen |
b75cab |
echo "outfile=\"o-tiffcrop-extractz14-$$base.tiff\"" ; \
|
|
roentgen |
b75cab |
echo "f_test_convert \"\$$TIFFCROP -E left -Z1:4,2:4\" \$$infile \$$outfile" ; \
|
|
roentgen |
b75cab |
echo "f_tiffinfo_validate \$$outfile" ; \
|
|
roentgen |
b75cab |
) > $$testscript ; \
|
|
roentgen |
b75cab |
chmod +x $$testscript ; \
|
|
roentgen |
b75cab |
done
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
generate-tiffcrop-tests: \
|
|
roentgen |
b75cab |
generate-tiffcrop-R90-tests \
|
|
roentgen |
b75cab |
generate-tiffcrop-doubleflip-tests \
|
|
roentgen |
b75cab |
generate-tiffcrop-extract-tests \
|
|
roentgen |
b75cab |
generate-tiffcrop-extractz14-tests
|
|
roentgen |
b75cab |
|
|
roentgen |
b75cab |
generate-tests: \
|
|
roentgen |
b75cab |
generate-tiff2rgba-tests \
|
|
roentgen |
b75cab |
generate-tiffcrop-tests
|