Results 1 to 4 of 4

Thread: QImageIOHandler question

  1. #1
    Join Date
    Nov 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default QImageIOHandler question

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QImageIOHandler question

    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.

  3. #3
    Join Date
    Nov 2007
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QImageIOHandler question

    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:
    Qt Code:
    1. QImage *image=new QImage();
    2. image->load("filePath1");
    3. osg::Node * node=osgDB::readNodeFile("someOtherLargeFile");
    To copy to clipboard, switch view to plain text mode 

    The failed scenario:
    Qt Code:
    1. osg::Node * node=osgDB::readNodeFile("someOtherLargeFile");
    2. QImage *image=new QImage();
    3. image->load("filePath1");
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QImageIOHandler question

    You might try debugging the QImage::load routine and see when it fails. Maybe this gives you an insight how to work it around.

Similar Threads

  1. Access to QSqlTableModel::isDirty Question.
    By patrik08 in forum Qt Programming
    Replies: 3
    Last Post: 12th April 2007, 17:49
  2. Replies: 1
    Last Post: 15th March 2007, 20:45
  3. Question regarding how to paint after zoom.
    By JonathanForQT4 in forum Qt Programming
    Replies: 2
    Last Post: 26th January 2007, 15:34
  4. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.