Revert "Move most TIFF tools to archive and keep some as unsupported (see #580)."

This reverts commit eab89a627f.

# Conflicts:
#	tools/unsupported/CMakeLists.txt
#	tools/unsupported/tif_tools-unsupported_versioninfo.rc
This commit is contained in:
Su_Laus
2024-05-11 16:49:55 +02:00
parent cf0bdb6729
commit 9ab54a8580
174 changed files with 1123 additions and 275 deletions

View File

@@ -51,7 +51,6 @@ else()
endif()
option(tiff-tools "build TIFF tools" ON)
option(tiff-tools-unsupported "build unsupported TIFF tools" OFF)
option(tiff-tests "build TIFF tests" ON)
option(tiff-contrib "build TIFF contrib" ON)
option(tiff-docs "build TIFF documentation" ON)
@@ -125,6 +124,9 @@ include(WebPCodec)
# Option for C++ libtiffxx library
include(CXXLibrary)
# Checks for OpenGL support
include(OpenGLChecks)
# Windows support
include(WindowsSupport)
@@ -144,9 +146,6 @@ add_subdirectory(libtiff)
if(tiff-tools)
add_subdirectory(tools)
endif()
if(tiff-tools-unsupported)
add_subdirectory(tools/unsupported)
endif()
if(tiff-tests)
add_subdirectory(test)
endif()
@@ -177,7 +176,6 @@ message(STATUS " C compiler: ${CMAKE_C_COMPILER}")
message(STATUS " C++ compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}")
message(STATUS " Build tools: ${tiff-tools}")
message(STATUS " Build tools-unsupported: ${tiff-tools-unsupported}")
message(STATUS " Build tests: ${tiff-tests}")
message(STATUS " Build contrib: ${tiff-contrib}")
message(STATUS " Build docs: ${tiff-docs}")
@@ -228,5 +226,7 @@ message(STATUS " ZSTD support: Requested:${zstd} Availabi
message(STATUS " WEBP support: Requested:${webp} Availability:${WebP_FOUND} Support:${WEBP_SUPPORT}")
message(STATUS "")
message(STATUS " C++ support: ${cxx} (requested) ${CXX_SUPPORT} (availability)")
# message(STATUS " X Athena Widgets support: ${HAVE_XAW}")
message(STATUS "")
# message(STATUS " X Athena Widgets support: ${HAVE_XAW}")
message(STATUS " OpenGL support: Requested:${tiff-opengl} Availability:${HAVE_OPENGL} Support:${OPENGL_SUPPORT}")
message(STATUS "")

View File

@@ -60,7 +60,7 @@ distcheck-hook:
rm -rf $(distdir)/_build/cmake
rm -rf $(distdir)/_inst/cmake
SUBDIRS = port libtiff tools build contrib test doc tools/unsupported
SUBDIRS = port libtiff tools build contrib test doc
NEW_LIBTIFF_RELEASE_DATE=$(shell date +"%Y%m%d")

View File

@@ -1,7 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with G3 compression, 1 dimensional
# encoding, and zero-filled boundaries.
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c g3:1d:fill" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-1d-fill.tiff"

View File

@@ -1,6 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with G3 compression and 1 dimensional encoding.
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c g3:1d" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-1d.tiff"

View File

@@ -1,7 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with G3 compression, 2 dimensional
# encoding, and zero-filled boundaries.
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c g3:2d:fill" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-2d-fill.tiff"

View File

@@ -1,6 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with G3 compression and 2 dimensional encoding.
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c g3:2d" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-2d.tiff"

View File

@@ -1,6 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with G3 compression
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c g3" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3.tiff"

View File

@@ -1,6 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with G4 compression
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c g4" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g4.tiff"

View File

@@ -1,7 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with logluv compression
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c none" "${srcdir}/images/logluv-3c-16b.tiff" "o-tiffcp-logluv-raw.tiff"
f_test_convert "${TIFFCP} -c sgilog" "o-tiffcp-logluv-raw.tiff" "o-tiffcp-logluv-sgilog.tiff"

View File

@@ -1,6 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with LZW Old-LZW decompression
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c none" "${IMG_QUAD_LZW_COMPAT}" "o-tiffcp-lzw-compat.tiff"

View File

@@ -1,6 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp with LZW decompression
#
. ${srcdir:-.}/common.sh
f_test_convert "${TIFFCP} -c none -r 1" "${IMG_LZW_SINGLE_STROP}" "o-tiffcp-lzw-scanline-decode.tiff"

View File

@@ -1,16 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp + tiffsplit + tiffcp
#
# First we use tiffcp to join our test files into a multi-frame TIFF
# then we use tiffsplit to split them out again, and then we use
# tiffcp to recombine again.
. ${srcdir:-.}/common.sh
conjoined=o-tiffcp-split-join-conjoined.tif
reconjoined=o-tiffcp-split-join-reconjoined.tif
splitfile=o-tiffcp-split-join-split-
f_test_convert "${TIFFCP}" "${IMG_UNCOMPRESSED}" "${conjoined}"
f_test_convert "${TIFFSPLIT}" "${conjoined}" "${splitfile}"
f_test_convert "${TIFFCP}" "${splitfile}*" "${reconjoined}"

View File

@@ -1,13 +0,0 @@
#!/bin/sh
#
# Basic sanity check for tiffcp + tiffsplit
#
# First we use tiffcp to join our test files into a multi-frame TIFF
# and then we use tiffsplit to split them out again.
#
. ${srcdir:-.}/common.sh
conjoined=o-tiffcp-split-conjoined.tif
splitfile=o-tiffcp-split-split-
f_test_convert "${TIFFCP}" "${IMG_UNCOMPRESSED}" "${conjoined}"
f_test_convert "${TIFFSPLIT}" "${conjoined}" "${splitfile}"

View File

@@ -1,55 +1,50 @@
# Tag Image File Format (TIFF) Software
# Checks for OpenGL and GLUT support
#
# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
# Copyright © 2015 Open Microscopy Environment / University of Dundee
# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# Process this file with automake to produce Makefile.in.
# OpenGL and GLUT
set(OpenGL_GL_PREFERENCE LEGACY)
LIBPORT = $(top_builddir)/port/libport.la
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
find_package(OpenGL COMPONENTS OpenGL)
find_package(GLUT)
EXTRA_DIST = \
CMakeLists.txt
set(OPENGL_SUPPORT FALSE)
set(HAVE_OPENGL FALSE)
if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
set(HAVE_OPENGL TRUE)
endif()
(echo tifftoolsunsupported: $(TIFF_TOOLS_UNSUPPORTED))
if TIFF_TOOLS_UNSUPPORTED
bin_PROGRAMS = \
tiff2pdf \
tiff2ps
endif
# Purely to satisfy the generated headers:
check_include_file(GL/gl.h HAVE_GL_GL_H)
check_include_file(GL/glu.h HAVE_GL_GLU_H)
check_include_file(GL/glut.h HAVE_GL_GLUT_H)
check_include_file(GLUT/glut.h HAVE_GLUT_GLUT_H)
check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
EXTRA_PROGRAMS =
option(tiff-opengl "use OpenGL (required for tiffgt viewer)" ${HAVE_OPENGL})
if HAVE_RPATH
AM_LDFLAGS = $(LIBDIR)
endif
tiff2pdf_SOURCES = tiff2pdf.c
tiff2pdf_LDADD = $(LIBTIFF) $(LIBPORT)
tiff2ps_SOURCES = tiff2ps.c
tiff2ps_LDADD = $(LIBTIFF) $(LIBPORT)
AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port
echo:
(echo $(CFLAGS))
(echo tifftoolsunsupported: $(TIFF_TOOLS_UNSUPPORTED))
if (tiff-opengl AND HAVE_OPENGL)
set(OPENGL_SUPPORT TRUE)
endif()

View File

@@ -320,12 +320,6 @@ AC_ARG_ENABLE(tools,
[TIFF_TOOLS=$enableval], [TIFF_TOOLS=yes])
AM_CONDITIONAL(TIFF_TOOLS, test "$TIFF_TOOLS" = "yes")
AC_ARG_ENABLE(tools-unsupported,
AS_HELP_STRING([--enable-tools-unsupported],
[Enable building of unsupported tools]),
[TIFF_TOOLS_UNSUPPORTED=$enableval], [TIFF_TOOLS_UNSUPPORTED=no])
AM_CONDITIONAL(TIFF_TOOLS_UNSUPPORTED, test "$TIFF_TOOLS_UNSUPPORTED" = "yes")
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--disable-tests],
[Disable building of tests]),
@@ -966,6 +960,38 @@ fi
AM_CONDITIONAL(HAVE_CXX, test "$HAVE_CXX" = "yes")
dnl ---------------------------------------------------------------------------
dnl Check for OpenGL and GLUT.
dnl ---------------------------------------------------------------------------
HAVE_OPENGL=no
AC_ARG_ENABLE(opengl,
AS_HELP_STRING([--disable-opengl],
[disable OpenGL usage (required by tiffgt, enabled by default)]),,)
if test "x$enable_opengl" != "xno" ; then
AC_PATH_XTRA
dnl AX_CHECK_GL sets GL_CFLAGS & GL_LIBS. Also PTHREAD_LIBS,
dnl PTHREAD_CFLAGS, & PTHREAD_CC as a side-effect
AX_CHECK_GL
dnl AX_CHECK_GLU sets GLU_CFLAGS & GLU_LIBS
AX_CHECK_GLU
dnl AX_CHECK_GLUT sets GLUT_CFLAGS & GLUT_LIBS
AX_CHECK_GLUT
if test "$no_x" != "yes" -a "$no_gl" != "yes" \
-a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then
HAVE_OPENGL=yes
fi
fi
AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes")
dnl ---------------------------------------------------------------------------
dnl Check for Win32 IO: make sure we have windows.h but not cygwin
dnl ---------------------------------------------------------------------------
@@ -1187,8 +1213,7 @@ AC_CONFIG_FILES([Makefile \
libtiff/tiffvers.h \
port/Makefile \
test/Makefile \
tools/Makefile \
tools/unsupported/Makefile])
tools/Makefile])
AC_OUTPUT
dnl ---------------------------------------------------------------------------
@@ -1207,7 +1232,6 @@ LOC_MSG([ Documentation directory: ${LIBTIFF_DOCDIR}])
LOC_MSG([ C compiler: ${CC} ${CFLAGS}])
LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
LOC_MSG([ Build tools: ${TIFF_TOOLS}])
LOC_MSG([ Build tools-unsupported: ${TIFF_TOOLS_UNSUPPORTED}])
LOC_MSG([ Build tests: ${TIFF_TESTS}])
LOC_MSG([ Build contrib: ${TIFF_CONTRIB}])
LOC_MSG([ Build docs: ${TIFF_DOCS}])
@@ -1245,5 +1269,6 @@ LOC_MSG()
LOC_MSG([ C++ support: ${HAVE_CXX}])
LOC_MSG()
dnl LOC_MSG([ X Athena Widgets support: ${HAVE_XAW}])
LOC_MSG([ OpenGL support: ${HAVE_OPENGL}])
LOC_MSG()

View File

@@ -103,10 +103,26 @@ rst_sources = \
index.rst \
build.rst \
internals.rst \
tools/tiffgt.rst \
tools/tiffdither.rst \
tools/tiff2pdf.rst \
tools/tiff2ps.rst \
tools/ppm2tiff.rst \
tools/raw2tiff.rst \
tools/fax2tiff.rst \
tools/tiffcrop.rst \
tools/tiff2bw.rst \
tools/fax2ps.rst \
tools/thumbnail.rst \
tools/tiffcmp.rst \
tools/tiffdump.rst \
tools/tiff2rgba.rst \
tools/tiffinfo.rst \
tools/rgb2ycbcr.rst \
tools/tiffset.rst \
tools/tiffsplit.rst \
tools/tiffmedian.rst \
tools/pal2rgb.rst \
tools/tiffcp.rst \
project/license.rst \
project/index.rst \

View File

@@ -617,16 +617,20 @@ necessary to manually do this work on a non-UNIX system.
Testing the software
--------------------
You can try
Assuming you have working versions of :doc:`/tools/tiffgt`, you can now use
it to view any of the sample images available for testing, or try
:doc:`/tools/tiffinfo` to display the file metadata. See the
:doc:`images` section on obtaining the test images.
Otherwise, you can do a cursory check of the library
with the :doc:`/tools/tiffcp` program. For example,
:doc:`images` section on obtaining the test images. Otherwise, you can
do a cursory check of the library with the :doc:`/tools/tiffcp` and
:doc:`/tools/tiffcmp` programs. For example,
.. code-block:: shell
tiffcp -lzw cramps.tif x.tif
tiffcmp cramps.tif x.tif
(:program:`tiffcmp` should be silent if the files compare
correctly).
LibTIFF source files

View File

@@ -92,9 +92,25 @@ html_extra_path = []
man_pages = [
('functions/libtiff', 'libtiff', 'introduction to libtiff, a library for reading and writing TIFF files', author, '3tiff'),
('tools/fax2ps', 'fax2ps', 'convert a TIFF facsimile to compressed PostScript™', author, 1),
('tools/fax2tiff', 'fax2tiff', 'create a TIFF Class F fax file from raw fax data', author, 1),
('tools/pal2rgb', 'pal2rgb', 'convert a palette color TIFF image to a full color image', author, 1),
('tools/ppm2tiff', 'ppm2tiff', 'create a TIFF file from PPM, PGM and PBM image files', author, 1),
('tools/raw2tiff', 'raw2tiff', 'create a TIFF file from a raw data file', author, 1),
('tools/rgb2ycbcr', 'rgb2ycbcr', 'convert non-YCbCr TIFF images to a YCbCr TIFF image', author, 1),
('tools/thumbnail', 'thumbnail', 'create a TIFF file with thumbnail images', author, 1),
('tools/tiff2bw', 'tiff2bw', 'convert a color TIFF image to greyscale', author, 1),
('tools/tiff2pdf', 'tiff2pdf', 'convert a TIFF image to a PDF document', author, 1),
('tools/tiff2ps', 'tiff2ps', 'convert TIFF image to PostScript™', author, 1),
('tools/tiff2rgba', 'tiff2rgba', 'convert a TIFF image to RGBA color space', author, 1),
('tools/tiffcmp', 'tiffcmp', 'compare two TIFF files', author, 1),
('tools/tiffcp', 'tiffcp', 'copy (and possibly convert) a TIFF file', author, 1),
('tools/tiffcrop', 'tiffcrop', 'select, copy, crop, convert, extract, and/or process one or more TIFF files', author, 1),
('tools/tiffdither', 'tiffdither', 'convert a greyscale TIFF image to bilevel using dithering', author, 1),
('tools/tiffdump', 'tiffdump', 'print verbatim information about TIFF files', author, 1),
('tools/tiffgt', 'tiffgt', 'display an image stored in a TIFF file (Silicon Graphics version)', author, 1),
('tools/tiffinfo', 'tiffinfo', 'print information about TIFF files', author, 1),
('tools/tiffmedian', 'tiffmedian', 'apply the median cut algorithm to data in a TIFF file', author, 1),
('tools/tiffset', 'tiffset', 'set or unset a field in a TIFF header', author, 1),
('tools/tiffsplit', 'tiffsplit', 'split a multi-image TIFF into single-image TIFF files', author, 1),

View File

@@ -108,8 +108,8 @@ by overriding the put methods as described above for supporting
alternate raster formats.
Simply keep a reference to the default put methods setup by
:c:func:`TIFFRGBAImageBegin` and then invoke them before or after
each display operation.
An example for a "put" method to
each display operation. For example, the
:doc:`/tools/tiffgt` utility uses the following put method to
update the display as the raster is being filled:
::

View File

@@ -814,9 +814,19 @@ Warning messages are likewise directed through the
See also
--------
:doc:`/tools/fax2tiff`,
:doc:`/tools/pal2rgb`,
:doc:`/tools/ppm2tiff`,
:doc:`/tools/rgb2ycbcr`,
:doc:`/tools/raw2tiff`,
:doc:`/tools/tiff2bw`,
:doc:`/tools/tiffdither`,
:doc:`/tools/tiffdump`,
:doc:`/tools/tiffcp`,
:doc:`/tools/tiffcmp`,
:doc:`/tools/tiffgt`,
:doc:`/tools/tiffinfo`,
:doc:`/tools/tiffmedian`,
:doc:`/tools/tiffsplit`,
**"Tag Image File Format Specification *Revision 6.0*"**,

View File

@@ -5,13 +5,12 @@ TIFF Tools Overview
:width: 144
:alt: quad
Since LibTIFF version 4.6.0 only five tools are suported.
Two tools can be built as unsupported into directory
:file:`tools/unsupported`.
The source code of the other tools is moved to directory
:file:`archive/tools/`.
This source code still serves as a programming example
for the use of the TIFF library.
This software distribution comes with a small collection of
programs for converting non-TIFF format images to TIFF and for
manipulating and interrogating the contents of TIFF images. Several
of these tools are useful in their own right. Many of them however
are more intended to serve as programming examples for using the
TIFF library.
Manual pages
------------
@@ -20,28 +19,120 @@ Manual pages
:maxdepth: 1
:titlesonly:
tools/fax2ps
tools/fax2tiff
tools/pal2rgb
tools/ppm2tiff
tools/raw2tiff
tools/rgb2ycbcr
tools/thumbnail
tools/tiff2bw
tools/tiff2pdf
tools/tiff2ps
tools/tiff2rgba
tools/tiffcmp
tools/tiffcp
tools/tiffcrop
tools/tiffdither
tools/tiffdump
tools/tiffgt
tools/tiffinfo
tools/tiffmedian
tools/tiffset
tools/tiffsplit
Programs
--------
Device-dependent Programs
-------------------------
There are two device-dependent programs that serve as simple
examples for writing programs to display and save TIFF images.
.. list-table:: Programs
.. list-table:: Device-dependent programs
:widths: 5 20
:header-rows: 1
* - Tool
- Description
* - :doc:`tools/tiffgt`
- Display the contents of one or more TIFF images using OpenGL.
The software makes extensive use of the ``TIFFRGBAImage``
facilities described elsewhere.
Device-independent Programs
---------------------------
The remaining programs should be device-independent:
.. list-table:: Device-dependent programs
:widths: 5 20
:header-rows: 1
* - Tool
- Description
* - :doc:`tools/fax2ps`
- Convert a Group 3- or Group 4- compressed TIFF to PostScript
that is significantly more compressed than is generated by
:program:`tiff2ps` (unless :program:`tiff2ps` writes PS Level II)
* - :doc:`tools/fax2tiff`
- Convert raw Group 3 or Group 4 facsimile data to TIFF
* - :doc:`tools/pal2rgb`
- Convert a Palette-style image to a full color RGB image by
applying the colormap
* - :doc:`tools/ppm2tiff`
- A quick hack that converts 8-bit PPM format images to TIFF
* - :doc:`tools/raw2tiff`
- Create a TIFF file from raw data
* - :doc:`tools/rgb2ycbcr`
- Convert an RGB, grayscale, or bilevel TIFF image to a YCbCr
TIFF image; it's mainly provided for testing
* - :doc:`tools/thumbnail`
- Copy a bilevel TIFF to one that includes 8-bit greyscale
"thumbnail images" for each page; it is provided as an example of
how one might use the ``SubIFD`` tag (and the library support
for it)
* - :doc:`tools/tiff2bw`
- A simple program to convert a color image to grayscale
* - :doc:`tools/tiff2pdf`
- Convert TIFF images to PDF
* - :doc:`tools/tiff2ps`
- Convert TIFF images to PostScript
* - :doc:`tools/tiff2rgba`
- Convert a TIFF image to RGBA color space
* - :doc:`tools/tiffcmp`
- Compare the contents of two TIFF files (it does not check all
the directory information, but does check all the data)
* - :doc:`tools/tiffcp`
- Copy, concatenate, and convert TIFF images (e.g. switching from
``Compression=5`` to ``Compression=1``)
* - :doc:`tools/tiffcrop`
- Provides selection of images from within one or more multi-image
TIFF files, with orthogonal rotation, mirroring, cropping, and
extraction of multiple sections and exporting to one or more files.
It extends the functionality of :program:`tiffcp` to support additional bit
depths in strips and tiles and enhances the selection capabilities of
tiffsplit. Bilevel images can be inverted and images may be split into
segments to fit on multiple /pages/ (standard paper sizes), plus other
functions described in the tiffcrop man page
* - :doc:`tools/tiffdither`
- Dither a b&w image into a bilevel image (suitable for use
in creating fax files)
* - :doc:`tools/tiffdump`
- Display the verbatim contents of the TIFF directory in a file
(it's very useful for debugging bogus files that you may get from
@@ -50,6 +141,10 @@ Programs
* - :doc:`tools/tiffinfo`
- Display information about one or more TIFF files
* - :doc:`tools/tiffmedian`
- A version of Paul Heckbert's median cut program that reads an
RGB TIFF image, and creates a TIFF palette file as a result
* - :doc:`tools/tiffset`
- Set a field in a TIFF header

View File

@@ -247,7 +247,9 @@ as follows:
See also
--------
:doc:`pal2rgb` (1),
:doc:`tiffinfo` (1),
:doc:`tiffdump` (1),
:doc:`tiffcmp` (1),
:doc:`tiffmedian` (1),
:doc:`tiffsplit` (1),
:doc:`/functions/libtiff` (3tiff)

View File

@@ -58,5 +58,8 @@ Options
See also
--------
:doc:`tiffdump`,
:doc:`pal2rgb`,
:doc:`tiffcp`,
:doc:`tiffcmp`,
:doc:`tiffmedian`,
:doc:`/functions/libtiff`

View File

@@ -40,6 +40,18 @@
/* Define to 1 if you have the `getopt' function. */
#cmakedefine HAVE_GETOPT 1
/* Define to 1 if you have the <GLUT/glut.h> header file. */
#cmakedefine HAVE_GLUT_GLUT_H 1
/* Define to 1 if you have the <GL/glut.h> header file. */
#cmakedefine HAVE_GL_GLUT_H 1
/* Define to 1 if you have the <GL/glu.h> header file. */
#cmakedefine HAVE_GL_GLU_H 1
/* Define to 1 if you have the <GL/gl.h> header file. */
#cmakedefine HAVE_GL_GL_H 1
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine HAVE_IO_H 1
@@ -49,6 +61,12 @@
/* Define to 1 if you have the `mmap' function. */
#cmakedefine HAVE_MMAP 1
/* Define to 1 if you have the <OpenGL/glu.h> header file. */
#cmakedefine HAVE_OPENGL_GLU_H 1
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#cmakedefine HAVE_OPENGL_GL_H 1
/* Define to 1 if you have the `setmode' function. */
#cmakedefine HAVE_SETMODE 1

View File

@@ -40,6 +40,18 @@
/* Define to 1 if you have the `getopt' function. */
#undef HAVE_GETOPT
/* Define to 1 if you have the <GLUT/glut.h> header file. */
#undef HAVE_GLUT_GLUT_H
/* Define to 1 if you have the <GL/glut.h> header file. */
#undef HAVE_GL_GLUT_H
/* Define to 1 if you have the <GL/glu.h> header file. */
#undef HAVE_GL_GLU_H
/* Define to 1 if you have the <GL/gl.h> header file. */
#undef HAVE_GL_GL_H
/* Define to 1 if you have the <io.h> header file. */
#undef HAVE_IO_H
@@ -49,6 +61,12 @@
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
/* Define to 1 if you have the <OpenGL/glu.h> header file. */
#undef HAVE_OPENGL_GLU_H
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#undef HAVE_OPENGL_GL_H
/* Define to 1 if you have the `setmode' function. */
#undef HAVE_SETMODE

View File

@@ -165,6 +165,408 @@ AC_DEFUN([AX_LANG_COMPILER_MS],
ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms
])])
dnl ---------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/ax_check_gl.html
dnl ---------------------------------------------------------------------------
dnl SYNOPSIS
dnl
dnl AX_CHECK_GL
dnl
dnl DESCRIPTION
dnl
dnl Check for an OpenGL implementation. If GL is found, the required
dnl compiler and linker flags are included in the output variables
dnl "GL_CFLAGS" and "GL_LIBS", respectively. If no usable GL implementation
dnl is found, "no_gl" is set to "yes".
dnl
dnl If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the
dnl header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These
dnl preprocessor definitions may not be mutually exclusive.
dnl
dnl LICENSE
dnl
dnl Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
dnl
dnl This program is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 2 of the License, or (at your
dnl option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
dnl Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program. If not, see <http://www.gnu.org/licenses/>.
dnl
dnl As a special exception, the respective Autoconf Macro's copyright owner
dnl gives unlimited permission to copy, distribute and modify the configure
dnl scripts that are the output of Autoconf when processing the Macro. You
dnl need not follow the terms of the GNU General Public License when using
dnl or distributing such scripts, even though portions of the text of the
dnl Macro appear in them. The GNU General Public License (GPL) does govern
dnl all other use of the material that constitutes the Autoconf Macro.
dnl
dnl This special exception to the GPL applies to versions of the Autoconf
dnl Macro released by the Autoconf Archive. When you make and distribute a
dnl modified version of the Autoconf Macro, you may extend this special
dnl exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_CHECK_GL],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PATH_X])dnl
AC_REQUIRE([AX_PTHREAD])dnl
AC_LANG_PUSH([C])
AX_LANG_COMPILER_MS
AS_IF([test X$ax_compiler_ms = Xno],
[GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm"])
dnl
dnl Use x_includes and x_libraries if they have been set (presumably by
dnl AC_PATH_X).
dnl
AS_IF([test "X$no_x" != "Xyes"],
[AS_IF([test -n "$x_includes"],
[GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"])]
AS_IF([test -n "$x_libraries"],
[GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"]))
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h])
CPPFLAGS="${ax_save_CPPFLAGS}"
AC_CHECK_HEADERS([windows.h])
m4_define([AX_CHECK_GL_PROGRAM],
[AC_LANG_PROGRAM([[
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GL_H
# include <GL/gl.h>
# elif defined(HAVE_OPENGL_GL_H)
# include <OpenGL/gl.h>
# else
# error no gl.h
# endif]],
[[glBegin(0)]])])
AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
[ax_cv_check_gl_libgl="no"
case $host_cpu in
x86_64) ax_check_gl_libdir=lib64 ;;
*) ax_check_gl_libdir=lib ;;
esac
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lopengl32 -lGL"
for ax_lib in ${ax_check_libs}; do
AS_IF([test X$ax_compiler_ms = Xyes],
[ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
[ax_try_lib="${ax_lib}"])
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="${ax_try_lib}"; break],
[ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break],
[ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break])])])
done
AS_IF([test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes],
[LIBS='-framework OpenGL'
AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM],
[ax_cv_check_gl_libgl="$LIBS"])])
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}])
AS_IF([test "X$ax_cv_check_gl_libgl" = Xno],
[no_gl=yes; GL_CFLAGS=""; GL_LIBS=""],
[GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"])
AC_LANG_POP([C])
AC_SUBST([GL_CFLAGS])
AC_SUBST([GL_LIBS])
])dnl
dnl ---------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/ax_check_glu.html
dnl ---------------------------------------------------------------------------
dnl SYNOPSIS
dnl
dnl AX_CHECK_GLU
dnl
dnl DESCRIPTION
dnl
dnl Check for GLU. If GLU is found, the required preprocessor and linker
dnl flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS",
dnl respectively. If no GLU implementation is found, "no_glu" is set to
dnl "yes".
dnl
dnl If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the
dnl header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These
dnl preprocessor definitions may not be mutually exclusive.
dnl
dnl Some implementations (in particular, some versions of Mac OS X) are
dnl known to treat the GLU tesselator callback function type as "GLvoid
dnl (*)(...)" rather than the standard "GLvoid (*)()". If the former
dnl condition is detected, this macro defines "HAVE_VARARGS_GLU_TESSCB".
dnl
dnl LICENSE
dnl
dnl Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
dnl
dnl This program is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 2 of the License, or (at your
dnl option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
dnl Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program. If not, see <http://www.gnu.org/licenses/>.
dnl
dnl As a special exception, the respective Autoconf Macro's copyright owner
dnl gives unlimited permission to copy, distribute and modify the configure
dnl scripts that are the output of Autoconf when processing the Macro. You
dnl need not follow the terms of the GNU General Public License when using
dnl or distributing such scripts, even though portions of the text of the
dnl Macro appear in them. The GNU General Public License (GPL) does govern
dnl all other use of the material that constitutes the Autoconf Macro.
dnl
dnl This special exception to the GPL applies to versions of the Autoconf
dnl Macro released by the Autoconf Archive. When you make and distribute a
dnl modified version of the Autoconf Macro, you may extend this special
dnl exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_CHECK_GLU],
[AC_REQUIRE([AX_CHECK_GL])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
GLU_CFLAGS="${GL_CFLAGS}"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h])
CPPFLAGS="${ax_save_CPPFLAGS}"
m4_define([AX_CHECK_GLU_PROGRAM],
[AC_LANG_PROGRAM([[
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GLU_H
# include <GL/glu.h>
# elif defined(HAVE_OPENGL_GLU_H)
# include <OpenGL/glu.h>
# else
# error no glu.h
# endif]],
[[gluBeginCurve(0)]])])
AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
[ax_cv_check_glu_libglu="no"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
dnl
dnl First, check for the possibility that everything we need is already in
dnl GL_LIBS.
dnl
LIBS="${GL_LIBS} ${ax_save_LIBS}"
dnl
dnl libGLU typically links with libstdc++ on POSIX platforms.
dnl However, setting the language to C++ means that test program
dnl source is named "conftest.cc"; and Microsoft cl doesn't know what
dnl to do with such a file.
dnl
AC_LANG_PUSH([C++])
AS_IF([test X$ax_compiler_ms = Xyes],
[AC_LANG_PUSH([C])])
AC_LINK_IFELSE(
[AX_CHECK_GLU_PROGRAM],
[ax_cv_check_glu_libglu=yes],
[LIBS=""
ax_check_libs="-lglu32 -lGLU"
for ax_lib in ${ax_check_libs}; do
AS_IF([test X$ax_compiler_ms = Xyes],
[ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
[ax_try_lib="${ax_lib}"])
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM],
[ax_cv_check_glu_libglu="${ax_try_lib}"; break])
done
])
AS_IF([test X$ax_compiler_ms = Xyes],
[AC_LANG_POP([C])])
AC_LANG_POP([C++])
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}])
AS_IF([test "X$ax_cv_check_glu_libglu" = Xno],
[no_glu=yes; GLU_CFLAGS=""; GLU_LIBS=""],
[AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes],
[GLU_LIBS="$GL_LIBS"],
[GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"])])
AC_SUBST([GLU_CFLAGS])
AC_SUBST([GLU_LIBS])
dnl
dnl Some versions of Mac OS X include a broken interpretation of the GLU
dnl tesselation callback function signature.
dnl
AS_IF([test "X$ax_cv_check_glu_libglu" != Xno],
[AC_CACHE_CHECK([for varargs GLU tesselator callback function type],
[ax_cv_varargs_glu_tesscb],
[ax_cv_varargs_glu_tesscb=no
ax_save_CFLAGS="$CFLAGS"
CFLAGS="$GL_CFLAGS $CFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
# ifdef HAVE_GL_GLU_H
# include <GL/glu.h>
# else
# include <OpenGL/glu.h>
# endif]],
[[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])],
[ax_cv_varargs_glu_tesscb=yes])
CFLAGS="$ax_save_CFLAGS"])
AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes],
[AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
[Use nonstandard varargs form for the GLU tesselator callback])])])
])
dnl ---------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/ax_check_glut.html
dnl ---------------------------------------------------------------------------
dnl
dnl SYNOPSIS
dnl
dnl AX_CHECK_GLUT
dnl
dnl DESCRIPTION
dnl
dnl Check for GLUT. If GLUT is found, the required compiler and linker flags
dnl are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS",
dnl respectively. If GLUT is not found, "no_glut" is set to "yes".
dnl
dnl If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the
dnl header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These
dnl preprocessor definitions may not be mutually exclusive.
dnl
dnl LICENSE
dnl
dnl Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
dnl
dnl This program is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 2 of the License, or (at your
dnl option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
dnl Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program. If not, see <http://www.gnu.org/licenses/>.
dnl
dnl As a special exception, the respective Autoconf Macro's copyright owner
dnl gives unlimited permission to copy, distribute and modify the configure
dnl scripts that are the output of Autoconf when processing the Macro. You
dnl need not follow the terms of the GNU General Public License when using
dnl or distributing such scripts, even though portions of the text of the
dnl Macro appear in them. The GNU General Public License (GPL) does govern
dnl all other use of the material that constitutes the Autoconf Macro.
dnl
dnl This special exception to the GPL applies to versions of the Autoconf
dnl Macro released by the Autoconf Archive. When you make and distribute a
dnl modified version of the Autoconf Macro, you may extend this special
dnl exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_CHECK_GLUT],
[AC_REQUIRE([AX_CHECK_GLU])dnl
AC_REQUIRE([AC_PATH_XTRA])dnl
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADERS([GL/glut.h GLUT/glut.h])
CPPFLAGS="${ax_save_CPPFLAGS}"
GLUT_CFLAGS=${GLU_CFLAGS}
GLUT_LIBS=${GLU_LIBS}
m4_define([AX_CHECK_GLUT_PROGRAM],
[AC_LANG_PROGRAM([[
# if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GLUT_H
# include <GL/glut.h>
# elif defined(HAVE_GLUT_GLUT_H)
# include <GLUT/glut.h>
# else
# error no glut.h
# endif]],
[[glutMainLoop()]])])
dnl
dnl If X is present, assume GLUT depends on it.
dnl
AS_IF([test X$no_x != Xyes],
[GLUT_LIBS="${X_PRE_LIBS} -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"])
AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut],
[ax_cv_check_glut_libglut="no"
AC_LANG_PUSH(C)
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lglut32 -lglut"
for ax_lib in ${ax_check_libs}; do
AS_IF([test X$ax_compiler_ms = Xyes],
[ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`],
[ax_try_lib="${ax_lib}"])
LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM],
[ax_cv_check_glut_libglut="${ax_try_lib}"; break])
done
AS_IF([test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes],
[LIBS='-framework GLUT'
AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM],
[ax_cv_check_glut_libglut="$LIBS"])])
CPPFLAGS="${ax_save_CPPFLAGS}"
LIBS="${ax_save_LIBS}"
AC_LANG_POP(C)])
AS_IF([test "X$ax_cv_check_glut_libglut" = Xno],
[no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS=""],
[GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"])
AC_SUBST([GLUT_CFLAGS])
AC_SUBST([GLUT_LIBS])
])dnl
dnl ---------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/autoconf-archive/ax_pthread.html

View File

@@ -102,7 +102,6 @@ set(noinst_HEADERS tifftest.h)
set(simple_tests)
# Test programs
add_executable(test_signed_tags ../placeholder.h)
target_sources(test_signed_tags PRIVATE test_signed_tags.c)
target_link_libraries(test_signed_tags PRIVATE tiff tiff_port)
@@ -381,10 +380,13 @@ foreach(target IN LISTS simple_tests)
endforeach()
if(tiff-tools)
# Reading / writing TIFF images with different encoding schemes.
add_convert_tests(tiffcp TIFFIMG "" TIFFIMAGES TRUE)
# PPM
add_convert_test(ppm2tiff miniswhite "" "images/miniswhite-1c-1b.pbm" TRUE)
add_convert_test(ppm2tiff minisblack "" "images/minisblack-1c-8b.pgm" TRUE)
add_convert_test(ppm2tiff rgb "" "images/rgb-3c-16b.ppm" TRUE)
add_convert_test(ppm2tiff rgb "" "images/rgb-3c-8b.ppm" TRUE)
# Convert some images to another coding scheme.
# tiffcp
add_convert_test(tiffcp g3 "-c g3" "images/miniswhite-1c-1b.tiff" FALSE)
add_convert_test(tiffcp g31d "-c g3:1d" "images/miniswhite-1c-1b.tiff" FALSE)
add_convert_test(tiffcp g31dfill "-c g3:1d:fill" "images/miniswhite-1c-1b.tiff" FALSE)
@@ -393,6 +395,8 @@ add_convert_tests(tiffcp TIFFIMG "" TIFFIMAGES TRUE)
add_convert_test(tiffcp g4 "-c g4" "images/miniswhite-1c-1b.tiff" FALSE)
add_convert_test_multi(tiffcp tiffcp "" logluv "-c none" "-c sgilog" ""
"images/logluv-3c-16b.tiff" FALSE)
add_convert_test_multi(tiffcp thumbnail "" thumbnail "-c g3:1d" "" ""
"images/miniswhite-1c-1b.tiff" FALSE)
add_convert_test(tiffcp none "-c none" "images/quad-lzw-compat.tiff" FALSE)
add_convert_test(tiffcp noner1 "-c none -r 1" "images/lzw-single-strip.tiff" FALSE)
add_convert_test(tiffcp float64_lzw_2_le "-c lzw:2" "images/test_float64_predictor2_le_lzw.tif" FALSE)
@@ -400,10 +404,6 @@ add_convert_tests(tiffcp TIFFIMG "" TIFFIMAGES TRUE)
if(WEBP_SUPPORT)
add_convert_test(tiffcp webp_lossless_rgba_alpha_fully_opaque "-c none" "images/webp_lossless_rgba_alpha_fully_opaque.tif" FALSE)
endif()
# Old-JPEG tests
#--- tiffcp does not support subsampled images, as the OldJPEG ones are ---
# ToDo: a test for OldJPEG is missing.
#add_convert_tests(test_tiffcp OldJPEG "" TIFFIMAGES_OJPEG TRUE)
# tiffdump
add_reader_test(tiffdump "" "images/miniswhite-1c-1b.tiff")
@@ -434,4 +434,28 @@ add_convert_tests(tiffcp TIFFIMG "" TIFFIMAGES TRUE)
${tiff_test_extra_args}
-P "${CMAKE_CURRENT_SOURCE_DIR}/TiffSplitTest.cmake")
# PDF
add_stdout_test(tiff2pdf "" "" "images/miniswhite-1c-1b.tiff" TRUE)
# PS
add_stdout_test(tiff2ps "ps-1" "-a -p -1" "images/miniswhite-1c-1b.tiff" TRUE)
add_stdout_test(tiff2ps "ps-2" "-a -p -2" "images/miniswhite-1c-1b.tiff" TRUE)
add_stdout_test(tiff2ps "ps-3" "-a -p -3" "images/miniswhite-1c-1b.tiff" TRUE)
add_stdout_test(tiff2ps "eps-1" "-e -1" "images/miniswhite-1c-1b.tiff" TRUE)
# BW
add_convert_tests(tiff2bw default "" RGBIMAGES TRUE)
# RGBA
add_convert_tests(tiff2rgba default "" TIFFIMAGES TRUE)
# RGBA (old-jpeg)
add_convert_tests(tiff2rgba default "" TIFFIMAGES_OJPEG TRUE)
# Test rotations
add_convert_tests(tiffcrop R90 "-R90" TIFFIMAGES TRUE)
# Test flip (mirror)
add_convert_tests(tiffcrop doubleflip "-F both" TIFFIMAGES TRUE)
# Test extracting a section 60 pixels wide and 60 pixels high
add_convert_tests(tiffcrop extract "-U px -E top -X 60 -Y 60" TIFFIMAGES TRUE)
# Test extracting the first and fourth quarters from the left side.
add_convert_tests(tiffcrop extractz14 "-E left -Z1:4,2:4" TIFFIMAGES TRUE)
endif()

View File

@@ -57,8 +57,11 @@ CLEANFILES = test_packbits.tif o-*
if HAVE_JPEG
if TIFF_TOOLS
JPEG_DEPENDENT_CHECK_PROG=raw_decode
# No tiff2rgba tool anymore and therefore not JPEG_DEPENDENT_TESTSCRIPTS
JPEG_DEPENDENT_TESTSCRIPTS=
JPEG_DEPENDENT_TESTSCRIPTS=\
tiff2rgba-quad-tile.jpg.sh \
tiff2rgba-ojpeg_zackthecat_subsamp22_single_strip.sh \
tiff2rgba-ojpeg_chewey_subsamp21_multi_strip.sh \
tiff2rgba-ojpeg_single_strip_no_rowsperstrip.sh
endif
else
JPEG_DEPENDENT_CHECK_PROG=
@@ -80,6 +83,10 @@ endif
# Test scripts to execute
if TIFF_TOOLS
TESTSCRIPTS = \
ppm2tiff_pbm.sh \
ppm2tiff_pgm.sh \
ppm2tiff_ppm.sh \
fax2tiff.sh \
tiffcp-g3.sh \
tiffcp-g3-1d.sh \
tiffcp-g3-1d-fill.sh \
@@ -87,12 +94,74 @@ TESTSCRIPTS = \
tiffcp-g3-2d-fill.sh \
tiffcp-g4.sh \
tiffcp-logluv.sh \
tiffcp-thumbnail.sh \
tiffcp-lzw-compat.sh \
tiffcp-lzw-scanline-decode.sh \
tiffdump.sh \
tiffinfo.sh \
tiffcp-split.sh \
tiffcp-split-join.sh \
tiff2ps-PS1.sh \
tiff2ps-PS2.sh \
tiff2ps-PS3.sh \
tiff2ps-EPS1.sh \
tiff2pdf.sh \
tiffcrop-doubleflip-logluv-3c-16b.sh \
tiffcrop-doubleflip-minisblack-1c-16b.sh \
tiffcrop-doubleflip-minisblack-1c-8b.sh \
tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \
tiffcrop-doubleflip-miniswhite-1c-1b.sh \
tiffcrop-doubleflip-palette-1c-1b.sh \
tiffcrop-doubleflip-palette-1c-4b.sh \
tiffcrop-doubleflip-palette-1c-8b.sh \
tiffcrop-doubleflip-rgb-3c-16b.sh \
tiffcrop-doubleflip-rgb-3c-8b.sh \
tiffcrop-extract-logluv-3c-16b.sh \
tiffcrop-extract-minisblack-1c-16b.sh \
tiffcrop-extract-minisblack-1c-8b.sh \
tiffcrop-extract-minisblack-2c-8b-alpha.sh \
tiffcrop-extract-miniswhite-1c-1b.sh \
tiffcrop-extract-palette-1c-1b.sh \
tiffcrop-extract-palette-1c-4b.sh \
tiffcrop-extract-palette-1c-8b.sh \
tiffcrop-extract-rgb-3c-16b.sh \
tiffcrop-extract-rgb-3c-8b.sh \
tiffcrop-extractz14-logluv-3c-16b.sh \
tiffcrop-extractz14-minisblack-1c-16b.sh \
tiffcrop-extractz14-minisblack-1c-8b.sh \
tiffcrop-extractz14-minisblack-2c-8b-alpha.sh \
tiffcrop-extractz14-miniswhite-1c-1b.sh \
tiffcrop-extractz14-palette-1c-1b.sh \
tiffcrop-extractz14-palette-1c-4b.sh \
tiffcrop-extractz14-palette-1c-8b.sh \
tiffcrop-extractz14-rgb-3c-16b.sh \
tiffcrop-extractz14-rgb-3c-8b.sh \
tiffcrop-R90-logluv-3c-16b.sh \
tiffcrop-R90-minisblack-1c-16b.sh \
tiffcrop-R90-minisblack-1c-8b.sh \
tiffcrop-R90-minisblack-2c-8b-alpha.sh \
tiffcrop-R90-miniswhite-1c-1b.sh \
tiffcrop-R90-palette-1c-1b.sh \
tiffcrop-R90-palette-1c-4b.sh \
tiffcrop-R90-palette-1c-8b.sh \
tiffcrop-R90-rgb-3c-16b.sh \
tiffcrop-R90-rgb-3c-8b.sh \
tiff2bw-palette-1c-8b.sh \
tiff2bw-quad-lzw-compat.sh \
tiff2bw-rgb-3c-8b.sh \
tiff2rgba-logluv-3c-16b.sh \
tiff2rgba-minisblack-1c-16b.sh \
tiff2rgba-minisblack-1c-8b.sh \
tiff2rgba-minisblack-2c-8b-alpha.sh \
tiff2rgba-miniswhite-1c-1b.sh \
tiff2rgba-palette-1c-1b.sh \
tiff2rgba-palette-1c-4b.sh \
tiff2rgba-palette-1c-8b.sh \
tiff2rgba-rgb-3c-16b.sh \
tiff2rgba-rgb-3c-8b.sh \
testfax4.sh \
testfax3_bug_513.sh \
testdeflatelaststripextradata.sh \
$(JPEG_DEPENDENT_TESTSCRIPTS)
else
TESTSCRIPTS=
@@ -231,3 +300,122 @@ memcheck:
ptrcheck:
$(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
# tiff2bw is pretty lame so currently only the generated scripts
# tiff2bw-palette-1c-8b.sh, tiff2bw-quad-lzw-compat.sh, and
# tiff2bw-rgb-3c-8b.sh pass tests.
generate-tiff2bw-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiff2bw-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiff2bw-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFF2BW\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
generate-tiff2rgba-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiff2rgba-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiff2rgba-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFF2RGBA\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
# Test rotations
generate-tiffcrop-R90-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiffcrop-R90-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiffcrop-R90-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFFCROP -R90\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
# Test flip (mirror)
generate-tiffcrop-doubleflip-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiffcrop-doubleflip-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiffcrop-doubleflip-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFFCROP -F both\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
# Test extracting a section 100 pixels wide and 100 pixels high
generate-tiffcrop-extract-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiffcrop-extract-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiffcrop-extract-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFFCROP -U px -E top -X 60 -Y 60\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
# Test extracting the first and fourth quarters from the left side.
generate-tiffcrop-extractz14-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiffcrop-extractz14-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiffcrop-extractz14-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFFCROP -E left -Z1:4,2:4\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
generate-tiffcrop-tests: \
generate-tiffcrop-R90-tests \
generate-tiffcrop-doubleflip-tests \
generate-tiffcrop-extract-tests \
generate-tiffcrop-extractz14-tests
generate-tests: \
generate-tiff2bw-tests \
generate-tiff2rgba-tests \
generate-tiffcrop-tests

0
archive/test/fax2tiff.sh → test/fax2tiff.sh Normal file → Executable file
View File

0
archive/test/ppm2tiff_pbm.sh → test/ppm2tiff_pbm.sh Normal file → Executable file
View File

0
archive/test/ppm2tiff_pgm.sh → test/ppm2tiff_pgm.sh Normal file → Executable file
View File

0
archive/test/ppm2tiff_ppm.sh → test/ppm2tiff_ppm.sh Normal file → Executable file
View File

24
test/testfax3_bug_513.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
#
# check decoding of a CCITT Group 3 encoded TIFF
# hitting https://gitlab.com/libtiff/libtiff/-/issues/513
. ${srcdir:-.}/common.sh
infile="${IMAGES}/testfax3_bug_513.tiff"
outfile="o-testfax3_bug_513.tiff"
rm -f $outfile
echo "$MEMCHECK ${TIFFCP} -c none $infile $outfile"
eval "$MEMCHECK ${TIFFCP} -c none $infile $outfile"
status=$?
if [ $status != 0 ] ; then
echo "Returned failed status $status!"
echo "Output (if any) is in \"${outfile}\"."
exit $status
fi
echo "$MEMCHECK ${TIFFCMP} $outfile ${REFS}/$outfile"
eval "$MEMCHECK ${TIFFCMP} $outfile ${REFS}/$outfile"
status=$?
if [ $status != 0 ] ; then
echo "Returned failed status $status!"
echo "\"${outfile}\" differs from reference file."
exit $status
fi

24
test/testfax4.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
#
# check decoding of a CCITT Group 4 encoded TIFF
# with 0 length runs
. ${srcdir:-.}/common.sh
infile="${IMAGES}/testfax4.tiff"
outfile="o-testfax4.tiff"
rm -f $outfile
echo "$MEMCHECK ${TIFFCP} -c lzw $infile $outfile"
eval "$MEMCHECK ${TIFFCP} -c lzw $infile $outfile"
status=$?
if [ $status != 0 ] ; then
echo "Returned failed status $status!"
echo "Output (if any) is in \"${outfile}\"."
exit $status
fi
echo "$MEMCHECK ${TIFFCMP} $outfile ${REFS}/$outfile"
eval "$MEMCHECK ${TIFFCMP} $outfile ${REFS}/$outfile"
status=$?
if [ $status != 0 ] ; then
echo "Returned failed status $status!"
echo "\"${outfile}\" differs from reference file."
exit $status
fi

View File

View File

0
archive/test/tiff2pdf.sh → test/tiff2pdf.sh Normal file → Executable file
View File

0
archive/test/tiff2ps-EPS1.sh → test/tiff2ps-EPS1.sh Normal file → Executable file
View File

0
archive/test/tiff2ps-PS1.sh → test/tiff2ps-PS1.sh Normal file → Executable file
View File

0
archive/test/tiff2ps-PS2.sh → test/tiff2ps-PS2.sh Normal file → Executable file
View File

0
archive/test/tiff2ps-PS3.sh → test/tiff2ps-PS3.sh Normal file → Executable file
View File

View File

View File

View File

Some files were not shown because too many files have changed in this diff Show More