Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] Load jpeg image

[SOLVED] Load jpeg image

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gamowaxaky
    wrote on last edited by
    #1

    Hi everyone,
    I have a problem when trying to load jpeg image into my app. I copied imageformats/qjeg4.dll into my app directory and used:
    @
    qApp->addLibraryPath(QApplication::applicationDirPath());
    qApp->addLibraryPath(QApplication::applicationDirPath() + "/imageformats");
    qDebug()<<QImageReader::supportedImageFormats();
    @
    but the last statement return:
    ("bmp", "pbm", "pgm", "png", "ppm", "xbm", "xpm")

    I have searched this forum and saw some related topics but the solutions didn't work for me.
    Could anyone help me?

    Thanks in advanced.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Code_ReaQtor
      wrote on last edited by
      #2

      how did you build your app? If you copied the dll file on the imageformats folder, you certainly dont need these lines.

      [quote author="gamowaxaky" date="1354564882"]
      @
      qApp->addLibraryPath(QApplication::applicationDirPath());
      qApp->addLibraryPath(QApplication::applicationDirPath() + "/imageformats");
      @
      [/quote]

      AFAIK, you only copied qjeg4.dll which is used only for "RELEASE". If you built your app in DEBUG, it will not work. You need to copy qjegd4.dll too.

      Please visit my open-source projects at https://github.com/Code-ReaQtor.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gamowaxaky
        wrote on last edited by
        #3

        Thanks Code_ReaQtor for your help.
        Finally I figured out that I used newer dlls version than the Qt version used to build my app. The problem was solved when I used the proper dlls, without any lines of the above code.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Code_ReaQtor
          wrote on last edited by
          #4

          [quote author="gamowaxaky" date="1354603370"]Thanks Code_ReaQtor for your help.[/quote]

          You're welcome. :)

          You may mark this thread as [Solved] then.

          Happy coding!

          Please visit my open-source projects at https://github.com/Code-ReaQtor.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved