| 1 |
Changes in TIFF v3.6.0 |
| 2 |
====================== |
| 3 |
|
| 4 |
.. table:: References |
| 5 |
:widths: auto |
| 6 |
|
| 7 |
====================== ========================================== |
| 8 |
Current Version v3.6.0 (:tag:`Release-v3-6-0`) |
| 9 |
Previous Version :doc:`v3.5.7 <v3.5.7>` |
| 10 |
Master Download Site `<https://download.osgeo.org/libtiff/>`_ |
| 11 |
Master HTTP Site `<http://www.simplesystems.org/libtiff/>`_ |
| 12 |
====================== ========================================== |
| 13 |
|
| 14 |
This document describes the changes made to the software between the |
| 15 |
*previous* and *current* versions (see above). |
| 16 |
If you don't find something listed here, then it was not done in this |
| 17 |
timeframe, or it was not considered important enough to be mentioned. |
| 18 |
The following information is located here: |
| 19 |
|
| 20 |
|
| 21 |
Major changes |
| 22 |
------------- |
| 23 |
|
| 24 |
* New utility :program:`raw2tiff` for converting raw rasters into TIFF files. |
| 25 |
* Lots of new :program:`tiff2ps` options. |
| 26 |
* Lots of new :program:`fax2tiff` options. |
| 27 |
* Lots of bug fixes for LZW, JPEG and OJPEG compression. |
| 28 |
|
| 29 |
Custom Tag Support |
| 30 |
^^^^^^^^^^^^^^^^^^ |
| 31 |
|
| 32 |
The approach to extending libtiff with custom tags has changed radically. |
| 33 |
Previously, all internally supported TIFF tags had a place in the |
| 34 |
private :c:struct:`TIFFDirectory` structure within libtiff to hold the values (if read), |
| 35 |
and a "field number" (ie. :c:macro:`FIELD_SUBFILETYPE`) used to identify that tag. |
| 36 |
However, every time a new tag was added to the core, the size of the |
| 37 |
:c:struct:`TIFFDirectory` structure would change, breaking any dynamically linked |
| 38 |
software that used the private data structures. |
| 39 |
|
| 40 |
Also, any tag not recognised |
| 41 |
by libtiff would not be read and accessible to applications without some |
| 42 |
fairly complicated work on the applications part to pre-register the tags |
| 43 |
as exemplified by the support for "Geo"TIFF tags by libgeotiff layered on |
| 44 |
libtiff. |
| 45 |
|
| 46 |
Among other things this approach required the extension code |
| 47 |
to access the private libtiff structures ... which made the higher level |
| 48 |
non-libtiff code be locked into a specific version of libtiff at compile time. |
| 49 |
This caused no end of bug reports! |
| 50 |
|
| 51 |
The new approach is for libtiff to read all tags from TIFF files. Those that |
| 52 |
aren't recognised as "core tags" (those having an associated ``FIELD_`` value, |
| 53 |
and place for storage in the :c:struct:`TIFFDirectory` structure) are now read into a |
| 54 |
dynamic list of extra tags (:c:member:`td_customValues` in :c:struct:`TIFFDirectory`). When a new |
| 55 |
tag code is encountered for the first time in a given TIFF file, a new |
| 56 |
anonymous tag definition is created for the tag in the tag definition list. |
| 57 |
The type, and some other metadata is worked out from the instance encountered. |
| 58 |
These fields are known as "custom tags". |
| 59 |
|
| 60 |
Custom tags can be set and fetched normally using :c:func:`TIFFSetField` and |
| 61 |
:c:func:`TIFFGetField`, and appear pretty much like normal tags to application code. |
| 62 |
However, they have no impact on internal libtiff processing (such as |
| 63 |
compression). Some utilities, such as :program:`tiffcp` will now copy these custom |
| 64 |
tags to the new output files. |
| 65 |
|
| 66 |
As well as the internal work with custom tags, new C API entry points |
| 67 |
were added so that extension libraries, such as libgeotiff, could |
| 68 |
define new tags more easily without accessing internal data structures. |
| 69 |
Because tag handling of extension tags is done via the "custom fields" |
| 70 |
mechanism as well, the definition provided externally mostly serves to provide |
| 71 |
a meaningful name for the tag. |
| 72 |
|
| 73 |
The addition of "custom tags" and the altered approach to extending libtiff |
| 74 |
with externally defined tags is the primary reason for the shift to the |
| 75 |
3.6.x version number from 3.5.x. |
| 76 |
|
| 77 |
Software configuration changes |
| 78 |
------------------------------ |
| 79 |
|
| 80 |
* :file:`configure`, :file:`config.site`: Fix for large files (>2GiB) support. New |
| 81 |
option in the config.site: ``LARGEFILE="yes"``. Should be enough for the large |
| 82 |
files I/O. |
| 83 |
|
| 84 |
* :file:`configure`: Set ``-DPIXARLOG_SUPPORT`` option along with ``-DZIP_SUPPORT``. |
| 85 |
|
| 86 |
* :file:`html/Makefile.in`: Updated to use :program:`groffhtml` for generating html pages |
| 87 |
from man pages. |
| 88 |
|
| 89 |
* :file:`configure`, :file:`libtiff/Makefile.in`: Added SCO OpenServer 5.0.6 support |
| 90 |
from John H. DuBois III. |
| 91 |
|
| 92 |
* :file:`libtiff/Makefile.vc`, :file:`libtiff/libtiff.def`: Missed declarations added. |
| 93 |
|
| 94 |
* :file:`libtiff/Makefile.in`, :file:`tools/Makefile.in`: Shared library will not be |
| 95 |
stripped when installing, utility binaries will do be stripped. As per bug :bugzilla-rs:`93`. |
| 96 |
|
| 97 |
* :file:`man/Makefile.in`: Patch ``DESTDIR`` handling as per bug :bugzilla-rs:`95`. |
| 98 |
|
| 99 |
* :file:`configure`: OpenBSD changes for Sparc64 and DSO version as per bug :bugzilla-rs:`96`. |
| 100 |
|
| 101 |
* :file:`config.site/configure`: added support for ``OJPEG=yes`` option to enable |
| 102 |
OJPEG support from :file:`config.site`. |
| 103 |
|
| 104 |
* :file:`config.gues`, :file:`config.sub`: Updated from `<ftp.gnu.org/pub/config>`_. |
| 105 |
|
| 106 |
* :file:`configure`: Modify ``CheckForBigEndian`` so it can work in a cross |
| 107 |
compiled situation. |
| 108 |
|
| 109 |
* :file:`configure`, :file:`libtiff/Makefile.in`: Changes for building on MacOS 10.1 |
| 110 |
as per bug :bugzilla-rs:`94`. |
| 111 |
|
| 112 |
* :file:`html/Makefile.in`: added missing images per bug :bugzilla-rs:`92`. |
| 113 |
|
| 114 |
* :file:`port/Makefile.in`: fixed clean target per bug :bugzilla-rs:`92`. |
| 115 |
|
| 116 |
|
| 117 |
Library changes |
| 118 |
--------------- |
| 119 |
|
| 120 |
* :file:`libtiff/tif_getimage.c`: New function :c:func:`TIFFReadRGBAImageOriented` |
| 121 |
implemented to retrieve raster array with user-specified origin position. |
| 122 |
|
| 123 |
* :file:`libtiff/tif_fax3.c`: Fix wrong line numbering. |
| 124 |
|
| 125 |
* :file:`libtiff/tif_dirread.c`: Check field counter against number of fields. |
| 126 |
|
| 127 |
* Store a list of opened IFD to prevent directory looping. |
| 128 |
|
| 129 |
* :file:`libtiff/tif_jpeg.c`: modified segment_height calculation to always |
| 130 |
be a full height tile for tiled images. Also changed error to just |
| 131 |
be a warning. |
| 132 |
|
| 133 |
* :file:`libtiff/tif_lzw.c`: fixed so that decoder state isn't allocated till |
| 134 |
:c:func:`LZWSetupDecode`. Needed to read LZW files in "``r+``" mode. |
| 135 |
|
| 136 |
* :file:`libtiff/tif_dir.c`: fixed up the :c:member:`tif_postdecode` settings responsible |
| 137 |
for byte swapping complex image data. |
| 138 |
|
| 139 |
* :file:`libtiff/tif_open.c`: Removed error if opening a compressed file |
| 140 |
in update mode bug (:bugzilla-rs:`198`). |
| 141 |
|
| 142 |
* :file:`libtiff/tif_write.c`: :c:func:`TIFFWriteCheck` now fails if the image is |
| 143 |
a pre-existing compressed image. That is, image writing to pre-existing |
| 144 |
compressed images is not allowed. |
| 145 |
|
| 146 |
* :file:`html/man/*.html`: Web pages regenerated from man pages. |
| 147 |
|
| 148 |
* :file:`libtiff/tif_jpeg.c`: Hack to ensure that "boolean" is defined properly |
| 149 |
on Windows so as to avoid the structure size mismatch error from libjpeg |
| 150 |
(bug :bugzilla-rs:`188`). |
| 151 |
|
| 152 |
* :file:`libtiff/tiff.h`: ``#ifdef USING_VISUALAGE`` around previous Visual Age |
| 153 |
AIX porting hack as it screwed up gcc. (bug :bugzilla-rs:`39`) |
| 154 |
|
| 155 |
* :file:`libtiff/tiff.h`: added :c:macro:`COMPRESSION_JP2000` (34712) for LEAD tools |
| 156 |
custom compression. |
| 157 |
|
| 158 |
* :file:`libtiff/tif_dirread.c`: Another fix for the fetching ``SBYTE`` arrays |
| 159 |
by the :c:func:`TIFFFetchByteArray` function. (bug :bugzilla-rs:`52`) |
| 160 |
|
| 161 |
* :file:`libtiff/tif_dirread.c`: Expand ``v[2]`` to ``v[4]`` in :c:func:`TIFFFetchShortPair` |
| 162 |
as per bug :bugzilla-rs:`196`. |
| 163 |
|
| 164 |
* :file:`libtiff/tif_lzw.c`: Additional consistency checking added in |
| 165 |
:c:func:`LZWDecode` and :c:func:`LZWDecodeCompat` fixing bugs |
| 166 |
:bugzilla-rs:`190` and :bugzilla-rs:`100`. |
| 167 |
|
| 168 |
* :file:`libtiff/tif_lzw.c`: Added check for valid code lengths in :c:func:`LZWDecode` |
| 169 |
and :c:func:`LZWDecodeCompat`. Fixes bug :bugzilla-rs:`115`. |
| 170 |
|
| 171 |
* :file:`tif_getimage.c`: Ensure that :c:func:`TIFFRGBAImageBegin` returns the |
| 172 |
return code from the underlying pick function as per bug :bugzilla-rs:`177`. |
| 173 |
|
| 174 |
* :file:`libtiff/tif_jpeg.c`, :file:`libtiff/tif_strip.c`, :file:`libtiff/tif_print.c`: |
| 175 |
Hacked :file:`tif_jpeg.c` to fetch :c:macro:`TIFFTAG_YCBCRSUBSAMPLING` from the jpeg |
| 176 |
data stream if it isn't present in the tiff tags as per bug :bugzilla-rs:`168`. |
| 177 |
|
| 178 |
* :file:`libtiff/tif_jpeg.c`: Fixed problem with setting of :c:var:`nrows` in |
| 179 |
:c:func:`JPEGDecode` as per bug :bugzilla-rs:`129`. |
| 180 |
|
| 181 |
* :file:`libtiff/tif_read.c`, :file:`libtiff/tif_write.c`: :c:func:`TIFFReadScanline` and |
| 182 |
:c:func:`TIFFWriteScanline` now set :c:member:`tif_row` explicitly in case the codec has |
| 183 |
fooled with the value as per bug :bugzilla-rs:`129`. |
| 184 |
|
| 185 |
* :file:`libtiff/tif_ojpeg.c`: Major upgrade from Scott. Details in bug :bugzilla-rs:`156`. |
| 186 |
|
| 187 |
* :file:`libtiff/tif_open.c`: Pointers to custom procedures |
| 188 |
in :c:func:`TIFFClientOpen` are checked to be not :c:macro:`NULL` pointers. |
| 189 |
|
| 190 |
* :file:`libtiff/tif_lzw.c`: Assertions in :c:func:`LZWDecode` and :c:func:`LZWDecodeCompat` |
| 191 |
replaced by warnings. Now libtiff should read corrupted LZW-compressed |
| 192 |
files by skipping bad strips as per bug :bugzilla-rs:`100`. |
| 193 |
|
| 194 |
* :file:`libtiff/tif_dirwrite.c`, :file:`libtiff/tif_write.c`, :file:`libtiff/tiffio.h`: |
| 195 |
:c:func:`TIFFCheckpointDirectory` routine added as per bug :bugzilla-rs:`124`. |
| 196 |
The :doc:`/functions/TIFFWriteDirectory` man page discusses this new function as well as the related |
| 197 |
:c:func:`TIFFRewriteDirectory`. |
| 198 |
|
| 199 |
* :file:`libtiff/tif_codec.c`, :file:`libtiff/tif_compress.c`, |
| 200 |
:file:`libtiff/tiffiop.h`, :file:`libtiff/tif_getimage.c`: |
| 201 |
Introduced additional members ``tif->tif_decodestatus`` and ``tif->tif_encodestatus`` |
| 202 |
for correct handling of unconfigured codecs (we should not try to read |
| 203 |
data or to define data size without correct codecs). See bug :bugzilla-rs:`119`. |
| 204 |
|
| 205 |
* :file:`tif_dirread.c`: avoid div-by-zero if :c:var:`rowbytes` is zero in chop func as |
| 206 |
per bug :bugzilla-rs:`111`. |
| 207 |
|
| 208 |
* :file:`libtiff/tiff.h`, :file:`libtiff/tif_dir.c`, :file:`libtiff/tif_dir.h`, |
| 209 |
:file:`libtiff/tif_dirinfo.c`, :file:`libtiff/tif_dirread.c`, :file:`libtiff/tif_dirwrite.c`: |
| 210 |
Dwight Kelly added get/put code for new tag ``XMLPACKET`` as |
| 211 |
defined in Adobe XMP Technote. Added missing ``INKSET`` tag value from TIFF 6.0 |
| 212 |
spec ``INKSET_MULTIINK`` (=2). Added missing tags from Adobe TIFF technotes: |
| 213 |
``CLIPPATH``, ``XCLIPPATHUNITS``, ``YCLIPPATHUNITS``, ``OPIIMAGEID``, ``OPIPROXY`` and |
| 214 |
``INDEXED``. Added ``PHOTOMETRIC`` tag value from TIFF technote 4 ``ICCLAB`` (=9). |
| 215 |
|
| 216 |
* :file:`libtiff/tif_getimage.c`: Additional check for supported codecs added in |
| 217 |
:c:func:`TIFFRGBAImageOK`, :c:func:`TIFFReadRGBAImage`, :c:func:`TIFFReadRGBAStrip` and |
| 218 |
:c:func:`TIFFReadRGBATile` now use :c:func:`TIFFRGBAImageOK` before reading a per bug |
| 219 |
:bugzilla-rs:`110`. |
| 220 |
|
| 221 |
* :file:`libtiff/tif_dir.c`, :file:`libtiff/tif_dir.h`, :file:`libtiff/tif_dirinfo.c`, |
| 222 |
:file:`libtiff/tif_dirread.c`, :file:`libtiff/tif_dirwrite.c`: |
| 223 |
Added routine :c:func:`TIFFDataWidth` for determining |
| 224 |
:c:enum:`TIFFDataType` sizes instead of working with :c:var:`tiffDataWidth` array |
| 225 |
directly as per bug :bugzilla-rs:`109`. |
| 226 |
|
| 227 |
* :file:`libtiff/tif_dirinfo.c`, :file:`libtiff/tif_dirwrite.c`: Added possibility to |
| 228 |
read broken TIFFs with ``LONG`` type used for :c:macro:`TIFFTAG_COMPRESSION`, |
| 229 |
:c:macro:`TIFFTAG_BITSPERSAMPLE`, :c:macro:`TIFFTAG_PHOTOMETRIC` as per bug |
| 230 |
:bugzilla-rs:`99`. |
| 231 |
|
| 232 |
* :file:`libtiff/tiff.h`, :file:`libtiff/tif_fax3.c`: Add support for |
| 233 |
:c:macro:``__arch64__`` as per bug :bugzilla-rs:`94`. |
| 234 |
|
| 235 |
* :file:`libtiff/tif_read.c`: Fixed :c:func:`TIFFReadEncodedStrip` to fail if the |
| 236 |
decodestrip function returns anything not greater than zero as per bug |
| 237 |
:bugzilla-rs:`97`. |
| 238 |
|
| 239 |
* :file:`libtiff/tif_jpeg.c`: fixed computation of :c:var:`segment_width` for |
| 240 |
tiled files to avoid error about it not matching the |
| 241 |
``cinfo.d.image_width`` values ("JPEGPreDecode: Improper JPEG strip/tile |
| 242 |
size.") for ITIFF files. Apparently the problem was incorporated since |
| 243 |
3.5.5, presumably during the OJPEG/JPEG work recently. |
| 244 |
|
| 245 |
* :file:`libtiff/tif_getimage.c`: If :c:macro:`DEFAULT_EXTRASAMPLE_AS_ALPHA` is 1 |
| 246 |
(defined in :file:`tiffconf.h` - 1 by default) then the RGBA interface |
| 247 |
will assume that a fourth extra sample is ``ASSOCALPHA`` if the |
| 248 |
``EXTRASAMPLE`` value isn't set for it. This changes the behaviour of |
| 249 |
the library, but makes it work better with RGBA files produced by |
| 250 |
lots of applications that don't mark the alpha values properly. |
| 251 |
As per bugs :bugzilla-rs:`93` and :bugzilla-rs:`65`. |
| 252 |
|
| 253 |
* :file:`libtiff/tif_jpeg.c`: allow jpeg data stream sampling values to |
| 254 |
override those from tiff directory. This makes this work with |
| 255 |
ImageGear generated files. |
| 256 |
|
| 257 |
|
| 258 |
Tools changes |
| 259 |
------------- |
| 260 |
|
| 261 |
* :program:`tiff2ps`: |
| 262 |
|
| 263 |
* Added page size setting when creating PS Level 2. |
| 264 |
|
| 265 |
* Fixed PS comment emitted when FlateDecode is being used. |
| 266 |
|
| 267 |
* :program:`tiffsplit`: increased the maximum number of pages that can be split. |
| 268 |
|
| 269 |
* :program:`raw2tiff`: |
| 270 |
|
| 271 |
* New utility for turning raw raster images into TIFF files |
| 272 |
written by Andrey Kiselev. |
| 273 |
|
| 274 |
* Added option "``-p``" to explicitly select color space of input image data. |
| 275 |
|
| 276 |
* :program:`tiffmedian`: Support for large (> 2GB) images. |
| 277 |
|
| 278 |
* :program:`ppm2tiff`: Fixed possible endless loop. |
| 279 |
|
| 280 |
* :program:`tiff2rgba`: Switched to use :c:func:TIFFReadRGBAImageOriented |
| 281 |
instead of :c:func:`TIFFReadRGBAImage`. |
| 282 |
|
| 283 |
* :program:`tiffcmp`: Fixed problem with unused data comparing (bug :bugzilla-rs:`349`). |
| 284 |
"``-z``" option now can be used to set the number of reported different bytes. |
| 285 |
|
| 286 |
* :program:`tiffcp`: |
| 287 |
|
| 288 |
* Added possibility to specify value -1 to "``-r``" option to get the entire image as one strip |
| 289 |
(bug :bugzilla-rs:`343`). |
| 290 |
|
| 291 |
* Set the correct ``RowsPerStrip`` and ``PageNumber`` values (bug :bugzilla-rs:`343`). |
| 292 |
|
| 293 |
* Fixed problem with colorspace conversion for JPEG encoded images (bugs :bugzilla-rs:`23` |
| 294 |
and :bugzilla-rs:`275`) |
| 295 |
|
| 296 |
* Added support for ``Orientation`` tag. |
| 297 |
|
| 298 |
* :program:`fax2tiff`: |
| 299 |
|
| 300 |
* Page numbering fixed (bug :bugzilla-rs:`341`). |
| 301 |
|
| 302 |
* Applied patch from Julien Gaulmin. More switches for :program:`fax2tiff` tool for better control |
| 303 |
of input and output (bugs :bugzilla-rs:`272` and :bugzilla-rs:`293`). |
| 304 |
|
| 305 |
* Updated to reflect latest changes in libtiff per bug :bugzilla-rs:`125`. |
| 306 |
|
| 307 |
* :program:`ppm2tiff`: PPM header parser improved: now able to skip comments. |
| 308 |
|
| 309 |
* :program:`tiff2ps`: |
| 310 |
|
| 311 |
* Sebastian Eken provided patches (bug :bugzilla-rs:`200`) to add new these new switches: |
| 312 |
|
| 313 |
"``-b #``": |
| 314 |
for a bottom margin of # inches |
| 315 |
"``-c``": |
| 316 |
center image |
| 317 |
"``-l #``": |
| 318 |
for a left margin of # inches |
| 319 |
"``-r``": |
| 320 |
rotate the image by 180 degrees |
| 321 |
|
| 322 |
Also, new features merged with code for shrinking/overlapping. |
| 323 |
|
| 324 |
* Force deadzone printing when EPS output specified (bug :bugzilla-rs:`325`). |
| 325 |
|
| 326 |
* Add ability to generate PS Level 3. It basically allows one to use the ``/flateDecode`` |
| 327 |
filter for ZIP compressed TIFF images. Patch supplied by Tom Kacvinsky |
| 328 |
(bug :bugzilla-rs:`328`). |
| 329 |
|
| 330 |
* Don't emit ``BeginData``/``EndData`` DSC comments since we are unable to properly |
| 331 |
include the amount to skip as per bug :bugzilla-rs:`80`. |
| 332 |
|
| 333 |
* Added workaround for some software that may crash when last strip of image contains fewer |
| 334 |
number of scanlines than specified by the ``/Height`` variable as per bug :bugzilla-rs:`164`. |
| 335 |
|
| 336 |
* Patch from John Williams to add new functionality for splitting long images in several pages as |
| 337 |
per bug :bugzilla-rs:`142`. New switches: |
| 338 |
|
| 339 |
"``-H #``": |
| 340 |
split image if height is more than # inches |
| 341 |
"``-L #``": |
| 342 |
overLap split images by # inches |
| 343 |
|
| 344 |
* New commandline switches to override resolution units obtained from the input file per |
| 345 |
bug :bugzilla-rs:`131`: |
| 346 |
|
| 347 |
"``-x``": |
| 348 |
override resolution units as centimeters |
| 349 |
"``-y``": |
| 350 |
override resolution units as inches |
| 351 |
|
| 352 |
* tiff2ps: Division by zero fixed as per bug :bugzilla-rs:`88`. |
| 353 |
|
| 354 |
* :program:`tiffdump`: include :c:macro:`TIFFTAG_JPEGTABLES` in tag list. |
| 355 |
|
| 356 |
* :program:`tiffset`: fix bug in error reporting. |
| 357 |
|
| 358 |
|
| 359 |
Contributed software changes |
| 360 |
---------------------------- |
| 361 |
|
| 362 |
* Fixed distribution to include :file:`contrib/addtiffo/tif_ovrcache.c`, :file:`contrib/addtiffo/tif_ovrcache.h`. |
| 363 |
|
| 364 |
* :file:`libtiff/contrib/win95`: renamed to :file:`contrib/win_dib`. Added new |
| 365 |
:file:`Tiffile.cpp` example of converting TIFF files into a DIB on Win32 as per |
| 366 |
bug :bugzilla-rs:`143`. |
| 367 |
|
| 368 |
|
| 369 |
LZW compression kit changes |
| 370 |
--------------------------- |
| 371 |
|
| 372 |
* LZW compression kit synchronized with actual libtiff version. |