Results 1 to 6 of 6

Thread: import large number of images

  1. #1
    Join Date
    May 2008
    Posts
    10
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question import large number of images

    hai everyone,

    I am trying to import large number of images into my mainwindow(for a photo management application) more than 5k images. But since when u try to load those many images the ram and the swap are completely filled. and it gives out of memory error.
    Also when loading limited collections(i expect the images to be displayed on runtime when the images are being imported but the images are'nt displayed on runtime and only displayed after the loading is complete.And the main window gets blurred until then.

    I am using qlistwidgetitem(icon mode) to display the images.and the icons are of standard 50*50 size.

    how could i accomodate largenumber of images(above 5k as i mentioned earlier) and how can I load the listwidgetitems load at run time? (Fedora core 8,Qt 4.3.4)

    Thanks in advance

    srihari

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: import large number of images

    I'd say that the only way to keep a view with that amount of thumbnails anyhow scalable is to show images on demand. Don't attempt to load all images in memory but re-use a certain set of items to show currently visible images.
    J-P Nurmi

  3. #3
    Join Date
    May 2008
    Posts
    10
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: import large number of images

    how do u do that exactly? I thought qt will take care of such things....

  4. #4
    Join Date
    May 2008
    Posts
    10
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: import large number of images

    I have been using the following code...

    listwidgetitem->setIconsize(QSize(50,50); //1
    listwidgetitem->setIcon(QIcon("/home..../temp.jpg"); //2

    how does qt store an icon? does it store the original image in RAM and scales it down when needed. or does it store the scaled down image in ram. if it is the first case then it eats up the memory.

    I have been looking into FSpot photo manager. he has been loading thausands of images and the ram was just occupying < 300MB.

    what do u think? if i could create a qpixmap scale it down pass that to the setIcon function and delete the original pixmap?

    I heard that libexif stores thumbnails along with other info so is it better if i use it?

  5. #5
    Join Date
    May 2008
    Posts
    10
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: import large number of images

    does anyone have ideas ?

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: import large number of images

    Try to know which items are visible...
    load images only in those items/labels.

    When u scroll, unload the images not in view and load new images,,,
    this might be tricky,,, but only thing i can think of as of now

  7. The following user says thank you to aamer4yu for this useful post:

    sriluyarlagadda (15th May 2008)

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13

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.