[Qt-interest] Multi-page TIFF?

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Mon Nov 30 12:08:07 CET 2009


Stephen Chu wrote on Saturday, November 28, 2009 5:41 AM:

> ... There's a bug filed for it
> and was close as out-of-scope (what does that mean anyway?)

It probably means exactly what it sais: "Reading/writing multi-page TIFF images is out-of-scope for the Qt toolkit". 

Qt is a great toolkit, but it is not a dedicated image manipulation toolkit. Qt does a good job with "all-day problems", such as quickly load and display an image, with a little bit of editing (and this is already an understatement, I know that Qt can to even more than that with images ;). There are better solutions for dedicated image processing.

That said, Qt lets you read/write some common image formats, but it has to provide a *common* API for all of them. Since "multi-page" is a feature commonly only found in TIFF format (but not JPEG, BMP, PNG ...), it does not make sense to provide a generic method such as QImage::getNextImage() or something like that.
   
> If this is the case, then what should I do to call libtiff directly?

Either this, or you use another library which handles more image formats and gives you better access to its features than the Qt API. 

I successfully once linked with http://www.imagemagick.org - the downside is you need to find a clever way how to convert between Magick "Image" and Qt "QImage" data structures. I went the lazy, inefficient but "bullet-proof" way to save QImage in-memory to PNG (lossless, supports alpha channel) and load is as such into a Magick Image image and the other way around. If you are a bit more daring than me you could directly access the pixel data and try to put it from the Image into QImage (or again the other way around).

By the way I used the C++ API http://www.imagemagick.org/Magick++/

Here is the "Magick Image" I was talking about: http://www.imagemagick.org/Magick++/Image.html

And the following answers your concrete question: "The STL interface must be used to operate on image sequences or images (e.g. of format GIF, TIFF, MIFF, Postscript, & MNG) which are comprized of multiple image frames." (So yes, Magick++ /does/ give you access to the individual frames ;)


Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list