Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, July 2007
QImage.load and dotsPerMeter for tiff images -> wrong values


Message 1 in thread

Hello all,
I have found a small problem when loading Tiff images with QImage.load(
filename ): the resolution stored in dotsPerMeter is not correctly set.
The Tiff images itself are valid (even used some examples from
http://www.remotesensing.org/libtiff/images.html).

When I load for example JPEG images, the resolution is correct.

The problem even existed with the TiffIO plugin (which itself used
libtiff) with Qt < 4.3.0.
Now I configured Qt 4.3.0 with -qt-libtiff and even there the problem
exists. Is it caused perhaps by libtiff itself, that is delivered with
Qt 4.3.0?

Do other people observe this?

Windows 2000 here. I have attached my test app.

Best regards!
Uli



#include <QApplication>
#include <QImage>
#include <iostream>
#include <QString>

int main (int argc, char**argv)
{
	if (argc != 2) {
		std::cout << "usage: testres <imagefile>" << std::endl;
		return 1;
	}
	QApplication app(argc,argv);
	QImage image = QImage();
	QString filename = QString( argv[1] );
	bool f = image.load( filename, 0 );
	if (f) {
		std::cout << image.dotsPerMeterX() << std::endl;
	}
	return 0;
}





--
 [ signature omitted ] 

Message 2 in thread

Hello again,

we found the problem: Qt's QTiffHandler does not read the resolution
property of tiffs at all. Same with the TiffIO plugin.

The work around is to path QTiffHandler. We will post this patch to
Trolltech.

Best regards,

Uli

--
 [ signature omitted ] 

Message 3 in thread

Hello again,

we found the problem: Qt's QTiffHandler does not read the resolution
property of tiffs at all. Same with the TiffIO plugin.

The work around is to path QTiffHandler. We will post this patch to
Trolltech.

Best regards,

Uli

--
 [ signature omitted ]