16703aca2SAndrey Kiselev<HTML> 26703aca2SAndrey Kiselev<HEAD> 36703aca2SAndrey Kiselev<TITLE> 46703aca2SAndrey Kiselev Changes in TIFF v4.0.0 56703aca2SAndrey Kiselev</TITLE> 66703aca2SAndrey Kiselev</HEAD> 76703aca2SAndrey Kiselev 86703aca2SAndrey Kiselev<BODY BGCOLOR=white> 96703aca2SAndrey Kiselev<FONT FACE="Helvetica, Arial, Sans"> 106703aca2SAndrey Kiselev<FONT FACE="Helvetica, Arial, Sans"> 116703aca2SAndrey Kiselev 126703aca2SAndrey Kiselev<BASEFONT SIZE=4> 136703aca2SAndrey Kiselev<B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B> 146703aca2SAndrey Kiselev<BASEFONT SIZE=3> 156703aca2SAndrey Kiselev 166703aca2SAndrey Kiselev<UL> 176703aca2SAndrey Kiselev<HR SIZE=4 WIDTH=65% ALIGN=left> 186703aca2SAndrey Kiselev<B>Current Version</B>: v4.0.0<BR> 19*aeb4c8beSBob Friesenhahn<B>Previous Version</B>: <A HREF=v3.9.0.html>v3.9.0</a><BR> 206703aca2SAndrey Kiselev<B>Master FTP Site</B>: <A HREF="ftp://ftp.remotesensing.org/pub/libtiff"> 216703aca2SAndrey Kiselevftp.remotesensing.org</a>, directory pub/libtiff</A><BR> 22d4099b8eSFrank Warmerdam<B>Master HTTP Site</B>: <A HREF="http://download.osgeo.org/libtiff"> 23d4099b8eSFrank Warmerdamhttp://download.osgeo.org/libtiff</a> 246703aca2SAndrey Kiselev<HR SIZE=4 WIDTH=65% ALIGN=left> 256703aca2SAndrey Kiselev</UL> 266703aca2SAndrey Kiselev 276703aca2SAndrey Kiselev<P> 286703aca2SAndrey KiselevThis document describes the changes made to the software between the 296703aca2SAndrey Kiselev<I>previous</I> and <I>current</I> versions (see above). 306703aca2SAndrey KiselevIf you don't find something listed here, then it was not done in this 316703aca2SAndrey Kiselevtimeframe, or it was not considered important enough to be mentioned. 326703aca2SAndrey KiselevThe following information is located here: 336703aca2SAndrey Kiselev<UL> 346703aca2SAndrey Kiselev<LI><A HREF="#hightlights">Major Changes</A> 356703aca2SAndrey Kiselev<LI><A HREF="#configure">Changes in the software configuration</A> 366703aca2SAndrey Kiselev<LI><A HREF="#libtiff">Changes in libtiff</A> 376703aca2SAndrey Kiselev<LI><A HREF="#tools">Changes in the tools</A> 386703aca2SAndrey Kiselev<LI><A HREF="#contrib">Changes in the contrib area</A> 396703aca2SAndrey Kiselev</UL> 406703aca2SAndrey Kiselev<p> 416703aca2SAndrey Kiselev<P><HR WIDTH=65% ALIGN=left> 426703aca2SAndrey Kiselev 436703aca2SAndrey Kiselev<!---------------------------------------------------------------------------> 446703aca2SAndrey Kiselev 4528b4b360SJoris Van Damme<P><A NAME="highlights"><B><FONT SIZE=+3>M</FONT>AJOR CHANGES:</B></A></P> 466703aca2SAndrey Kiselev 4728b4b360SJoris Van DammeBigTIFF support changes: 4828b4b360SJoris Van Damme 4928b4b360SJoris Van Damme<UL> 5028b4b360SJoris Van Damme 5180d98dc2SAndrey Kiselev <LI>The options parameter in the TIFFOpen and TIFFClientOpen funcs has 5280d98dc2SAndrey Kiselev been extended. When creating new files, you can add option '4' to 5380d98dc2SAndrey Kiselev specify you want to create a ClassicTIFF file, though that is the 5480d98dc2SAndrey Kiselev default and the option is not strictly necessary. (As such, old 5580d98dc2SAndrey Kiselev calling code will continue to function and create ClassicTIFF files.) 5680d98dc2SAndrey Kiselev Or you can add option '8' to specify you want to create a BigTIFF file 5780d98dc2SAndrey Kiselev instead. This new option is also reflected in some of the tools we 5880d98dc2SAndrey Kiselev already upgraded. For instance, you can use the -8 option on tiffcp to 5980d98dc2SAndrey Kiselev have tiffcp produce BigTIFF files instead of the default ClassicTIFF. 6080d98dc2SAndrey Kiselev (Whilst on additional option is provided for version selection when 6180d98dc2SAndrey Kiselev creating new files, no such option is necessary when reading TIFF 6280d98dc2SAndrey Kiselev files. LibTiff reads ClassicTIFF and BigTIFF both, and the application 6380d98dc2SAndrey Kiselev does not need to be aware which TIFF version an opened file is.) 6428b4b360SJoris Van Damme 6580d98dc2SAndrey Kiselev <LI>Although the tag count in BigTIFF is 64bit, we restricted the 6680d98dc2SAndrey Kiselev count in the implementation to a much more reasonable size. This is 6780d98dc2SAndrey Kiselev necessary in current implementation, because all tag data gets read 6880d98dc2SAndrey Kiselev automatically in the IFD reading stage, so if there's half a dozen 6980d98dc2SAndrey Kiselev private tags with multiple gigabytes of data that causes considerable 7080d98dc2SAndrey Kiselev overhead even if the application level is never interested in these 7180d98dc2SAndrey Kiselev tags. Our choice to ignore tags with data longer then a certain sanity 7280d98dc2SAndrey Kiselev value is much needed as things stand. We also recommend to step away 7380d98dc2SAndrey Kiselev from writing tiles that are 8 kilobyte in their uncompressed form, or 7480d98dc2SAndrey Kiselev writing single-line strips, in really big files, resulting in mega's 7580d98dc2SAndrey Kiselev of tiles or strips. It's much more efficient to choose bigger tile or 7680d98dc2SAndrey Kiselev strip sizes, up to several megabyte if needed, and have a few kilo of 7780d98dc2SAndrey Kiselev tiles or strips instead. 7828b4b360SJoris Van Damme 7980d98dc2SAndrey Kiselev <LI>Although it's rare, some application code does directly access 8080d98dc2SAndrey Kiselev file offsets. Some of these are automatically upgraded because they 8180d98dc2SAndrey Kiselev used the toff_t type, others need to be aware that the datatype 8280d98dc2SAndrey Kiselev changed and need to start using toff_t or uint64. This impacts access 8380d98dc2SAndrey Kiselev to tags like the EXIF IFD tag, for example, or the SubIfds tag, or to 8480d98dc2SAndrey Kiselev StripOffsets or TileOffsets, the return type of functions like 8580d98dc2SAndrey Kiselev TIFFCurrentDirOffset, and a parameter type to functions like 8680d98dc2SAndrey Kiselev TIFFSetSubDirectory. 8728b4b360SJoris Van Damme 8880d98dc2SAndrey Kiselev <LI>Although it's rare, some application code does use structures 8980d98dc2SAndrey Kiselev like TIFFHeader or TIFFDirEntry that used to be an exact binary 9080d98dc2SAndrey Kiselev representation of TIFF structures. These need to change. The old 9180d98dc2SAndrey Kiselev TIFFHeader structure is replaced by the new TIFFHeaderClassic, 9280d98dc2SAndrey Kiselev TIFFHeaderBig, and TIFFHeaderCommon structures that are an exact 9380d98dc2SAndrey Kiselev binary representation of the ClassicTIFF and BigTIFF header, and of 9480d98dc2SAndrey Kiselev the part that is common to both. There is no new equivalent for the 9580d98dc2SAndrey Kiselev old TIFFDirEntry structure (or more precisely, there is still a 9680d98dc2SAndrey Kiselev TIFFDirEntry structure, but it is changed, moved to library-private 9728b4b360SJoris Van Damme definition, and no longer an exact binary representation of the tag 9828b4b360SJoris Van Damme structure of either TIFF version). 9928b4b360SJoris Van Damme 10080d98dc2SAndrey Kiselev <LI>Sizer functions, like TIFFTileSize or TIFFScanlineSize and the 10180d98dc2SAndrey Kiselev like, return a tmsize_t value (tmsize_t is defined as int32 on 32bit 10280d98dc2SAndrey Kiselev machines, and int64 on 64bit machines, and as such it is meant to 10380d98dc2SAndrey Kiselev represent signed memory sizes). This is because we figure 98% of the 10480d98dc2SAndrey Kiselev calling code uses the return value as sizes in allocations and the 10580d98dc2SAndrey Kiselev like. So, any overflow that is theoretically possible with BigTIFF 10680d98dc2SAndrey Kiselev when LibTiff is running on a 32bit system, is best detected inside the 10780d98dc2SAndrey Kiselev sizer functions and it is best to return a type that makes sense as a 10880d98dc2SAndrey Kiselev memory size. If your calling code is the exception and is interested 10980d98dc2SAndrey Kiselev in actual file size, you best use the newer TIFFTileSize64 or 11080d98dc2SAndrey Kiselev TIFFScanlineSize64 function that returns an uint64 type. 11128b4b360SJoris Van Damme 11228b4b360SJoris Van Damme</UL> 11328b4b360SJoris Van Damme 11428b4b360SJoris Van DammeOther important backward incompatible changes in the public API: 1156703aca2SAndrey Kiselev 1166703aca2SAndrey Kiselev<UL> 1174441831fSAndrey Kiselev <LI> TIFFRewriteField() renamed into _TIFFRewriteField() and moved out 1184441831fSAndrey Kiselev from the public interface (from tiffio.h to tiffiop.h). Type of its 1194441831fSAndrey Kiselev 'count' parameter changed from uint32 to tmsize_t. 1204441831fSAndrey Kiselev 121875d6d38SAndrey Kiselev <LI> TIFFMergeFieldInfo() returns non-void result now. It returns 0 122875d6d38SAndrey Kiselev if successful and -1 if failed. Though this is now obsoleted function 123875d6d38SAndrey Kiselev and should not be used in new programs. Use the new tag extension 124875d6d38SAndrey Kiselev scheme instead. 125875d6d38SAndrey Kiselev 12680d98dc2SAndrey Kiselev <LI> TIFFFieldWithTag() and TIFFFieldWithName() functions now return 12780d98dc2SAndrey Kiselev pointer to TIFFField constant object instead of TIFFFieldInfo. 12880d98dc2SAndrey Kiselev 1296703aca2SAndrey Kiselev <LI> TIFFReassignTagToIgnore() function and TIFFIgnoreSense enumeration 1306703aca2SAndrey Kiselev have been removed. They was unused and never been used properly. 1316703aca2SAndrey Kiselev Should be unneeded for high-level applications. 1326703aca2SAndrey Kiselev 1336703aca2SAndrey Kiselev <LI> TIFFTagValue structure removed from the public tiffio.h 1346703aca2SAndrey Kiselev to private tif_dir.h and not accessible anymore. It should be unneeded 1356703aca2SAndrey Kiselev for high-level applications. 1366703aca2SAndrey Kiselev</UL> 1376703aca2SAndrey Kiselev 1386703aca2SAndrey Kiselev<P><HR WIDTH=65% ALIGN=left> 1396703aca2SAndrey Kiselev<!---------------------------------------------------------------------------> 1406703aca2SAndrey Kiselev 14128b4b360SJoris Van Damme<P><A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A></P> 1426703aca2SAndrey Kiselev 1436703aca2SAndrey Kiselev<UL> 1446703aca2SAndrey Kiselev 145*aeb4c8beSBob Friesenhahn <LI>Updated autotools: Autoconf 2.64, Automake 1.11, libtool 146*aeb4c8beSBob Friesenhahn 2.2.6. 147*aeb4c8beSBob Friesenhahn 148*aeb4c8beSBob Friesenhahn <LI>Enabled support for Automake silent build rules 149*aeb4c8beSBob Friesenhahn (--enable-silent-rules or 'make V=0') 150*aeb4c8beSBob Friesenhahn 151*aeb4c8beSBob Friesenhahn <LI>Enabled support for Automake colorized and parallel tests. 152*aeb4c8beSBob Friesenhahn 153*aeb4c8beSBob Friesenhahn <LI>Added detection of 64-bit integer types since libtiff 4.0 154*aeb4c8beSBob Friesenhahn requires use of 64-bit signed and unsigned integer types. 155*aeb4c8beSBob Friesenhahn 156*aeb4c8beSBob Friesenhahn <LI>Libtiff now provides a more comprehensive test suite with 157*aeb4c8beSBob Friesenhahn over 72 tests, which may be executed on Unix-like systems, or 158*aeb4c8beSBob Friesenhahn under Microsoft Windows using MinGW/MSYS or Cygwin. 159*aeb4c8beSBob Friesenhahn 1606703aca2SAndrey Kiselev</UL> 1616703aca2SAndrey Kiselev 1626703aca2SAndrey Kiselev<P><HR WIDTH=65% ALIGN=left> 1636703aca2SAndrey Kiselev 1646703aca2SAndrey Kiselev<!---------------------------------------------------------------------------> 1656703aca2SAndrey Kiselev 16628b4b360SJoris Van Damme<P><A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A></P> 1676703aca2SAndrey Kiselev 1686703aca2SAndrey Kiselev<UL> 1696703aca2SAndrey Kiselev 170*aeb4c8beSBob Friesenhahn <LI>Patches/fixes made to stable libtiff (v3.9.0) are also 171*aeb4c8beSBob Friesenhahn applied to 4.0.0. There are too many to list here. See the 172*aeb4c8beSBob Friesenhahn distribution ChangeLog for a detailed change list. 17328b4b360SJoris Van Damme 174*aeb4c8beSBob Friesenhahn <LI>There is considerable change in some files like 175*aeb4c8beSBob Friesenhahn tif_dirread and tif_dirwrite. These changes don't impact 176*aeb4c8beSBob Friesenhahn backwards compatibility, they are mostly a clean rewrite that 177*aeb4c8beSBob Friesenhahn does allow BigTIFF support as well as somewhat more robust 178*aeb4c8beSBob Friesenhahn reading of the unexpected already and will also serve future 179*aeb4c8beSBob Friesenhahn API extension but does not impact current API or functionality 180*aeb4c8beSBob Friesenhahn in a negative way that you need to know about. 18128b4b360SJoris Van Damme 182*aeb4c8beSBob Friesenhahn <LI>Although there is still a functional definition for types 183*aeb4c8beSBob Friesenhahn like toff_t (file offset), tstrip_t (strip index number), etc, 184*aeb4c8beSBob Friesenhahn we recommend against using these in newer code. We have 185*aeb4c8beSBob Friesenhahn learned that it is next to impossible to use these 186*aeb4c8beSBob Friesenhahn consistently and make real abstraction of the binary format of 187*aeb4c8beSBob Friesenhahn these types. Instead, at a certain level we always end up 188*aeb4c8beSBob Friesenhahn doing casts anyway, and taking the exact binary format into 189*aeb4c8beSBob Friesenhahn account, so these types are nothing but dangerously misleading 190*aeb4c8beSBob Friesenhahn and obfuscating. You do not need to update calling code that 191*aeb4c8beSBob Friesenhahn uses them, as 99.9% of such code will continue to work. But we 192*aeb4c8beSBob Friesenhahn recommend against using them in newer calling code, and we 193*aeb4c8beSBob Friesenhahn started replacing them with binary clear types like uint16, 194*aeb4c8beSBob Friesenhahn uint32 and such in the library. 195*aeb4c8beSBob Friesenhahn 196*aeb4c8beSBob Friesenhahn <LI>We do use and will continue to use one functional type 197*aeb4c8beSBob Friesenhahn that is an exception to the above rule, being tmsize_t. This 198*aeb4c8beSBob Friesenhahn is a signed memory size type, i.e. it is int32 on 32bit 199*aeb4c8beSBob Friesenhahn machines, or int64 on 64bit machines. 20028b4b360SJoris Van Damme 2016703aca2SAndrey Kiselev</UL> 2026703aca2SAndrey Kiselev 2036703aca2SAndrey Kiselev<P><HR WIDTH=65% ALIGN=left> 2046703aca2SAndrey Kiselev 2056703aca2SAndrey Kiselev<!--------------------------------------------------------------------------> 2066703aca2SAndrey Kiselev 20728b4b360SJoris Van Damme<P><A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A></P> 2086703aca2SAndrey Kiselev 2096703aca2SAndrey Kiselev<UL> 2106703aca2SAndrey Kiselev 2116703aca2SAndrey Kiselev</UL> 2126703aca2SAndrey Kiselev 2136703aca2SAndrey Kiselev<P><HR WIDTH=65% ALIGN=left> 2146703aca2SAndrey Kiselev 2156703aca2SAndrey Kiselev<!---------------------------------------------------------------------------> 2166703aca2SAndrey Kiselev 21728b4b360SJoris Van Damme<P><A NAME="contrib"><B><FONT SIZE=+3>C</FONT>HANGES IN THE CONTRIB AREA:</B></A></P> 2186703aca2SAndrey Kiselev 2196703aca2SAndrey Kiselev<UL> 2206703aca2SAndrey Kiselev</UL> 2216703aca2SAndrey Kiselev 222*aeb4c8beSBob FriesenhahnLast updated $Date: 2009-08-27 17:40:50 $. 2236703aca2SAndrey Kiselev 2246703aca2SAndrey Kiselev</BODY> 2256703aca2SAndrey Kiselev</HTML> 226