Results 1 to 4 of 4

Thread: check image is valid

  1. #1
    Join Date
    Sep 2009
    Location
    Warsaw/Poland
    Posts
    56
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 4 Times in 1 Post

    Default check image is valid

    Hi,

    How can I fast check is jpg image is valid ?

    There is
    Qt Code:
    1. QImage(strImagePath).isNull()
    To copy to clipboard, switch view to plain text mode 
    but I'm not sure is this the fastest way to check is image valid...

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

    Default Re: check image is valid

    What do you consider a "valid" image?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2009
    Location
    Warsaw/Poland
    Posts
    56
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 4 Times in 1 Post

    Default Re: check image is valid

    sometimes I have question mark in QWebView when jpg file is not fully downloaded in another thread.
    thats why I need fast check if jpg file is valid/correct

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

    Default Re: check image is valid

    It still doesn't explain what you mean by "valid". That it has a valid JPEG header or that it contains valid image data? If the former then you can check the file for the header, if the latter then either load the picture and look at it or analyze it and make sure all data is there (i.e. that the file is not truncated).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. .lib is not a valid Qt plugin
    By rickrvo in forum Qt for Embedded and Mobile
    Replies: 11
    Last Post: 22nd May 2011, 00:18
  2. No valid Qt version set?
    By RoryWalsh in forum Qt Tools
    Replies: 4
    Last Post: 21st October 2009, 09:02
  3. What constitutes valid Qt folder?
    By piotr.dobrogost in forum Installation and Deployment
    Replies: 22
    Last Post: 26th July 2009, 04:41
  4. QGLWidget::isValid() not valid in Qt-4.3.2?
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2008, 23:14
  5. valid a path name
    By klaus1111 in forum Newbie
    Replies: 3
    Last Post: 23rd July 2006, 16:07

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
  •  
Qt is a trademark of The Qt Company.