# Changes in TIFF v3.7.1

References
Current Version | v3.7.1 (tag Release-v3-7-1)
Previous Version | v3.7.0
Master Download Site | https://download.osgeo.org/libtiff/
Master HTTP Site | http://www.simplesystems.org/libtiff/

This document describes the changes made to the software between the previous and current versions (see above). If you don’t find something listed here, then it was not done in this timeframe, or it was not considered important enough to be mentioned. The following information is located here:

## Major changes

- This is mostly bugfix release. Most important fix is the one related to wrong custom tag read/write code.

## Software configuration changes

- `autogen.sh`: aclocal and autoheader should be executed after libtoolize. Also add `-I .` to aclocal invocation to check current directory for macros.

- nmake.opt: Link with the `user32.lib` in windowed mode. As per bug Remote Sensing bugzilla #697 [no longer available]

- `nmake.opt`, `makefile.vc`: make it easier to rename the libtiff DLL.

- `configure`, `configure.ac`: Added `--enable-rpath` option to embed linker paths into library binary.

## Library changes

- `tiff.h`: Revert back libtiff data type definitions as per bug Remote Sensing bugzilla #687 [no longer available]

- `tif_dirread.c`: Do not forget about `TIFF_VARIABLE2` when checking for tag count in `TIFFReadDirectory()` function. As per bug Remote Sensing bugzilla #713 [no longer available]

- `tif_getimage.c`: Support for multiple-alpha-channelled RGB-images as per bug Remote Sensing bugzilla #718 [no longer available]

- `tif_getimage.c`: `#define A1` bracketing for clean build on SunPro compiler.

- `tif_dirwrite.c`: Always write `TIFFTAG_SUBIFD` using `LONG` type as per bugs Remote Sensing bugzilla #703 [no longer available] and Remote Sensing bugzilla #704 [no longer available].

- `tif_win32.c`: Use char* strings instead of `TCHAR` in windowed mode as per bug Remote Sensing bugzilla #697 [no longer available]

- `tif_dir.c`, `tif_dirread.c`: Remove `TIFFReassignTagToIgnore()` call from the `TIFFReadDirectory()` function. `TIFFReassignTagToIgnore()` must be removed in the future, as it was never used properly. As per bug Remote Sensing bugzilla #692 [no longer available]

- `tif_jpeg.c`: Added a work-around in order to allow compilation with the heavily modified version of libjpeg delivered with Cygwin.

- `tif_dir.c`: Properly handle tags, which have the `uint32` counts. As per bug Remote Sensing bugzilla #693 [no longer available]

- `tif_unix.c`: Make UNIX module compilable (and usable) on Windows.

- `tiff.h`: Added Adobe DNG tags.

- `tif_aux.c`: Set the appropriate `ReferenceBlackWhite` array for YCbCr image which lacks that tag (noted by Hans Petter Selasky).

- `tif_color.c`: Division by zero fixed (Hans Petter Selasky).

- `tif_stream.cxx`, `tiffio.h`: Added C++ stream interface contributed by Edward Lam (see Remote Sensing bugzilla #654 [no longer available] for details). Those who want to use C++ streams should `#include <tiffio.hxx>`.

- `tif_open.c`: Removed `close()` in `TIFFClientOpen()` if file is bad. This is the callers responsibility. Remote Sensing bugzilla #651 [no longer available]

- `tiffio.h`, `tif_win32.c`, `libtiff.def`: Added `TIFFOpenW()` function to work with the double byte strings (used to represent filenames in some locales). As per bug Remote Sensing bugzilla #625 [no longer available]

- `tif_dirread.c`: Fixed problem when fetching `BitsPerSample` and `Compression` tags of type `LONG` from broken TIFFs as per bug Remote Sensing bugzilla #662 [no longer available]

- `tif_dirinfo.c`: Fixed definition for `TIFFTAG_RICHTIFFIPTC`, the writecount should have `uint32` type. As per bug Remote Sensing bugzilla #662 [no longer available]

- `tif_write.c`: Fixed wrong `if()` statement in `TIFFAppendToStrip()` function as per bug Remote Sensing bugzilla #660 [no longer available]

- `tif_dirinfo.c`: Change definition for `TIFFTAG_EXTRASAMPLES` field. The caller should supply a count when setting this field. As per bug Remote Sensing bugzilla #648 [no longer available].

- `tif_jpeg.c`, `tif_ojpeg.c`: `TIFFTAG_JPEGTABLES` should have uint32 count. Use this type everywhere.

- `tif_next.c`: avoid use of `u_long` and `u_char` types.

- `tif_fax3.c`: Fixed case with the wrong decode routines choosing when the incorrect `Group4Options` tag set. As per bug Remote Sensing bugzilla #323 [no longer available]

- `tif_dirwrite.c`: Fixed problem with passing count variable of wrong type when writing the `TIFF_BYTE`/`TIFF_SBYTE` tags in `TIFFWriteNormalTag()`.

- `tif_compress.c`: Zero division problem fixed (Vladimir Nadvornik, Dmitry V. Levin).

## Tools changes

- `fax2ps.c`: Be able to extract the first page (#0). As per bug Remote Sensing bugzilla #690 [no longer available]

- `tiff2ps.c`: Fixed wrong variable data type when read `Position` tags (Tristan Hill).

- `tiff2ps.c`: Fixed wrong variable data type when read `Resolution` tags (Peter Fales).

- `tiffset.c`: Check the `malloc()` return value (Dmitry V. Levin).

## Contributed software changes

- None.