PDA

View Full Version : QImageIOHandler question



guher
13th November 2007, 08:24
Hi,
In an application that tries to read an image via QImageIOHandler::read function in QImage::load function (Qt 4.3.1 ), If massive data from harddisk to cache has been loaded before calling QImage::load, QImageIOHandler can not read the image. On the other hand, If I load the image with QImage::load before some thread loads some massive data (e.g. occupies 1.5 gb in a 3 gb configuration) the QImageIOHandler successively reads the image. Therefore, in low cache memory, QImageIOHandler fails in my application. Is this a bug?
Thanks for the answers

wysota
13th November 2007, 09:01
Have you verified that the problem persists outside your application? Try a minimal app, that only loads an image and quits. Remember to create the application object, otherwise your image won't load.

guher
13th November 2007, 09:56
I have tried loading the image with QImage::load , and it succesfully reads.
But if I load some large data via an external library (non Qt) before calling QImage::load, the QImage::load failed (I changed their calling order in the code).
Then, I first loaded QImage::load and after that I called the external library's function, QImage::load worked perfect. So, I assume that the external library won't let QImage::load either with process priority or some other cause. The external library is openscenegraph and the scenarios seem like this:
The working scenario:



QImage *image=new QImage();
image->load("filePath1");
osg::Node * node=osgDB::readNodeFile("someOtherLargeFile");


The failed scenario:


osg::Node * node=osgDB::readNodeFile("someOtherLargeFile");
QImage *image=new QImage();
image->load("filePath1");

wysota
13th November 2007, 10:04
You might try debugging the QImage::load routine and see when it fails. Maybe this gives you an insight how to work it around.