EISL Open Source Library




Tiff RW routines sent by Duyong (Nov 13, 2004)
Email describing this package 
Code 

--------------------------------------------------------------------------------

TIFF R/W Release 1.0 - Download
This package has been tested on Linux, HPUX and Cygwin for PC. It contains

TIFF 6.0 Library (Version 3.6.1) 
JPEG Library (Version 6b) 
ZIP Library (Version 1.2.1) 
TIFF Read and Write subroutines 

Supported compression methods: 

LZW compression (Read/Write) 
OJPEG compression (Read Only) 
JPEG compression (Read/Write) 
ZIP / DEFLATE (Read/Write) 
Adobe Deflate compression (Read/Write) 
CCITT Fax Group 3 and Group 4 compressions (Read/Write) 
Huffman RLE compression (Read/Write) 
Macintosh RLE (Packbits) compression (Read/Write) 


Documentation:

Installation Guide 
TIFF Read and Write documentation 


Important notes:

Warning: LZW has been patented by Unisys. Please DO NOT distribute this package outside EISL. This package is for research purposes only. 
You are welcome to contribute to the future version of this package. Any other useful tools related to image processing are also welcome. 
Currently, you can report bugs, post your updates, an improved or enhanced version either through Du-Yong Ng (dng@purdue.edu) or Guotong Feng (fengg@ecn.purdue.edu). We has just begun to look for a volunteer to organize this site. Please let us know if you are interested. 

========= Installation guide ============
Procedures to install this package:
------------------------------------------------------
1) Download TIFF_RW_TIFFLIB_n_JPEGLIB_n_ZLIB.tar.gz
2) gunzip TIFF_RW_TIFFLIB_n_JPEGLIB_n_ZLIB.tar.gz
3) tar -cvf TIFF_RW_TIFFLIB_n_JPEGLIB_n_ZLIB.tar
4) Go to jpegsrc.v6b/jpeg-6b/ directory, execute
	a) ./configure
	b) make
5) Go to zlib-1.2.1/zlib-1.2.1/, execute
	a) ./configure
	b) make
6) Go to tiff-v3.6.1/tiff-v3.6.1/, execute
	a) ./configure
	b) make

To see how to use subroutines in TIFF_RW.c:
-----------------------------------------------------
1) Go to TIFF_RW directory, type make.
2) A test_TIFF_RW executable file is built in TIFF_RW/bin directory
   This program copies an input image file to an output image file
   ./test_TIFF_RW input.tif output.tif
   
   The output.tif is stored in TIFF_RW/img/output/ directory


============ I/O function ===================

***************************************************************************************
TIFF I/O Version: TIFF_RW Release 1.0
Author          : Du-Yong Ng
Email           : dng@purdue.edu
***************************************************************************************

Subroutines:
============
2D memory allocation subroutines:
---------------------------------
double **allocate_2DArray_double(int width,int height);
int **allocate_2DArray_int(int width,int height);
uint8 **allocate_2DArray_uint8(int width,int height);

Read TIFF image from filename.tif
---------------------------------- 
TIFF_img *Read_TIFF_File (char *filename, boolean *error_flag);
error_flag = 1 if error encountered, 0 otherwise
the partially read image is returned regardless and need to be freed using free_TIFF_img() before exiting.

Write write_img to outFilename.tif
----------------------------------
int Write_TIFF_File(TIFF_img *write_img, char *outFilename );
return 1 if writing is successful, 0 otherwise

Create a TIFF image buffer
--------------------------
TIFF_img *Create_New_img(uint32 width, uint32 height, uint16 samplesperpixel, uint16 bitspersample, uint16 photometric, boolean *error_flag);
error_flag = 1 if error encountered, 0 otherwise.
the partially allocated image is returned regardless and need to be freed using free_TIFF_img() before exiting.

Memory deallocation subroutines:
--------------------------------
void free_2D(void **pt);
void free_TIFF_img ( TIFF_img *img );

These subroutines were coded to read and write TIFF files using the TIFF 6.0 specifications.
This is a higher level I/O interface that wraps around the TIFF Library 6.0 lower level I/O 
from www.libtiff.org.

This version supports several compression (both encoding and decoding) methods:
1) OJPEG (read only)
2) LZW (read/write)
3) Macintosh RLE (Packbits) (read/write)
4) ZIP/Deflate (read/write)
5) Adobe Deflate (read/write)
6) CCITT Group 3 and 4, CCITT with modified Huffman RLE (read/write)
7) standard JPEG. (read/write)

The read and written bytes are filled in the native machine fillorder.




========= Eri's comment =========

TIFF library print error message anyway. If you want to see those message 
such as error tag message, you need to undefine 
_TIFFwarningHandler

by Eri

=================================





 
    Report Bugs/Send updates to:
Du-Yong Ng
Guotong Feng     


