[Home] [Documentation] [Download] [Status] [History] [Installation]


TiffIO 1.4.0
Jean-Dominique <dot> Gascuel <at> inrialpes.fr

TiffIO is a plugin that add TIFF images read/write capabilities to all Qt3 and Qt4 applications using the QImage class.

TiffIO come with a self-test suite (test.pro), and have been compiled and used successfully on a wide variety of systems, compilers and Qt version combination. A demo application (demo.pro) enables to quickly test image loading & viewing on any platform.

All TIFF operations are based on libtiff 3.9.4, this plugin is just a wrapper that enable to use it transparently from the QImage class, and the architecture defined by Qt.

[Home] [Documentation] [Download] [Status] [History] [Installation]
Documentation

Adding the plugin in the Qt's tree (or linking it witinh your own application) is sufficient to enable any Qt application to manipulate TIFF images transparently along with all other formats already managed by Qt.

Code snipets to reading TIFF images from a Qt application

To load a TIFF image from Qt, you can simply use the strainforward approche, as with any other image type supported :
		QImage img("Examples/rgb8-zip-mac.tif");
		if( ! img.isNull() ) // Load succeded ?
			...
	
A slightly more complex example (see the demo app), uses an image handler to get access to the description string (in Qt3) :
		QImageIO io("Examples/rgb8-zip-mac.tif");
		if( io.read() )	//Load succeeded ?
		{
			QString ... = io.format()	// Should be "TIFF"
			QImage  ... = io.image();
			QString ... = io.description();
		}
	
Or using the new Qt4 dialect :
		QImageReader reader("Examples/rgb8-zip-mac.tif");
		QImage img = reader.read();
		if( !img.isNull() )	 //Load succceded ?
		{
			QString ... = reader.format()	// Should be "TIFF"
			QString ... = reader.text("description");
		}
	

Code snipets to write TIFF images from a Qt application

Saving TIFF images can be as strainforward too :
		QImage img = ...
		if( ! img.save("Temp/snapshot.tif", "TIFF") )
			qWarning("save failed !");
	
Most probably, you should stop reading here. You know whatever you really need to save portable TIFF images...

But if you are sure you really need it, you can also use hints to request particular flavours of TIFF images to be created. Beware not all of the combinations will by obyed by TiffIO, and worst : some rare combination (while perfectly legal TIFF formats) won't be understood by other TIFF readers... Hints are provided a parameters string to the Qt library. Saving a 10-bit RGB lossless compressed image, with Qt3 :

		QImage img(100, 100, 32);
		...
		QImageIO io("Temp/snapshot.tif", "TIFF");
		io.setParameters("lzw bps=10");
		if( ! io.write() )
			qWarning("TIFF image save failed");		
	
Or a 64 colors image, uncompressed, using 6 bit indexes, using the Qt4 dialect:
		QImage img(100, 100, QImage::Format_Indexed8);
		img.setNumColors(64);
		...
		QImageWriter writer("Temp/snapsho.tif", "TIFF");
		writer.setText("parameters", "none bps=6");
		if( ! writer.write(img) )
			...	// Failed
	
This parameter string is a blank separated list of words. Recognized words are :

TIFF support

Current support for reading .tif into a QImage :

Current support for writting a QImage :

Experimental :

What is not supported at the time :

[Home] [Documentation] [Download] [Status] [History] [Installation]
Source download

Pre-compiled download

None at that time: because there is too many combination of versions of Qt, versions of compiler, and systems flavors...

[Home] [Documentation] [Download] [Status] [History] [Installation]
Status

I am using TiffIO on Win32/Qt 3.3.8b and 4.5.3, ``every days'', and I am not aware of any bugs. The self-test suite (just compile and execute the provided test.pro project) enable a quick checking of the plugin consistency for a given platform. If you have a doubt, you can also compile the demo.pro micro-application to have a look at any dubious .tiff file.

Known Bugs

I you find some bugs, or need support never encountered before TIFF variant, send e-mails to Jean-Dominique.Gascuel at imag.fr.

[Home] [Documentation] [Download] [Status] [History] [Installation]
History

[Home] [Documentation] [Download] [Status] [History] [Installation]
Installation

Pre-requisite

You should have Qt installed, and the QTDIR environement variable correctly defined. In particular, having several installation of Qt (eg. Qt3 and Qt4) installed works only if QTDIR/include, QTDIR/bin, QTDIR/lib etc. goes to the right places (eg. QTDIR=/usr/share/qt3 or QTDIR=/usr/share/qt4 under some linuxes).

Let's do it.

If you want to track what happends in TiffIO or in the embebed libtiff, you can compile and install TiffIO_DBG.pro instead.

Qt4 plugin management

Among the changes introduced by Qt4, there is a change in the policy when loading plugins. Now, the rules specify that a plugin is suitable to load only if it has been compiled with the same version and compile options that the main app loading it. It means that in order to have the plugin running both in release and in debug mode, you should compile and install both TiffIO.pro and TiffIO_DBG.pro.

Support of ZIP compression scheme inside TIFF images

If available, the Tiff library (and the TiffIO plugin), will automatically compile with the ZIP compression scheme to read or write more compact images.
This is an important feature, because many TIFF files available around are ZIP compressed.

Support of JPEG compression scheme inside TIFF images

The Tiff library also propose the JPEG lossy compression scheme embebed in TIFF images.
This is more exotic than ZIP compression, but may be needed in some rare cases.

Support for another TIFF library source

TiffIO is packaged with its own TIFF source distribution. This is important for stability and to make sure it is compiled with options compatible with Qt accross various platforms.

I strongly urge you not to compile with a different version of LibTiff... Nevertheless, some of your folks have to live dangerously for whatever reason, so the .pro files enable you to do that :

Testing

To run the self-test program, use the test.pro and run the generated executable. It should end saying All xxx the images checked ok. The corresponding cases are in the Example/ subdirectory.

You can also see samples, by compiling the demo.pro demo viewer.