Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]QImage fail to read jpeg--dll deploy problem
Forum Updated to NodeBB v4.3 + New Features

[Solved]QImage fail to read jpeg--dll deploy problem

Scheduled Pinned Locked Moved General and Desktop
16 Posts 3 Posters 16.0k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    stereomatching
    wrote on last edited by
    #6

    Thanks for your advices, I change the codes to

    @
    QImage image;
    QString const image_url = reply->url().toString();
    QByteArray image_array = reply->readAll();
    image.loadFromData(image_array); //fail to load the image_array

    QFile file("temp");
    
    if ( !file.exists()) qDebug() << "can't find";
    
    if(!file.open(QIODevice::WriteOnly) ) qDebug() << "can't open";
    
    file.write(image_array); //but the data could be save and display by other software
    

    @

    Maybe I should change the title to "QImage fail to read jpeg"

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #7

      Chances are you have not deployed the image format plugins (not that you really need them to save the downloaded image as JKSH points out).

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #8

        I release my program with the items as follow

        1 : release with the exe compile by mingw4.6.2
        2 : put other's dll in the same folder
        libgcc_s_dw2-1.dll, libstdc++-6.dll, mingwm10.dll, QtCore4.dll, QtGui4.dll, QtNetwork4.dll

        Test it on Virtual box and other pc, make sure it has the same behaviour on my pc

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #9

          Yup, that's a better title :) whi

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stereomatching
            wrote on last edited by
            #10

            I make the codes become easier to read
            @
            int main(int argc, char *argv[])
            {
            QApplication a(argc, argv);

            QImage image("temp.jpg");
            qDebug() << image.size(); //the size is (0, 0) even the jpg can be read by other software
            image.save("haha");
            
            return a.exec(&#41;;
            

            }
            @

            on my pc, it works prefectly, but other pc just don't work

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #11

              Interesting...

              Try this and see if you can get any useful info:
              @
              qDebug() << "Supported formats:" << QImageReader::supportedImageFormats();

              QImageReader reader("temp.jpg");
              qDebug() << "Can read file?:" << reader.canRead();

              QImage image = reader.read();
              qDebug() << reader.errorString();
              @

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • S Offline
                S Offline
                stereomatching
                wrote on last edited by
                #12

                Weird, extremely weird,same dll, same exe, same os

                on my pc, the answer are

                bq. Supported formats: ("bmp", "gif", "ico", "jpeg", "jpg", "mng", "pbm", "pgm", "pn
                g", "ppm", "svg", "svgz", "tga", "tif", "tiff", "xbm", "xpm")
                Can read file?: true
                "Unknown error"

                on other pc, the answer are

                Supported formats: ("bmp", "pbm", "pgm", "png", "ppm", "xbm", "xpm")
                Can read file?: false
                "Unsupported image format"

                1 Reply Last reply
                0
                • JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #13

                  Try copying C:[Qt-installation]\4.8.2\plugins\qjpeg4.dll

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    stereomatching
                    wrote on last edited by
                    #14

                    I copy the dll of plugins into the folder, but the QImage still don't support jpg

                    1 Reply Last reply
                    0
                    • JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by
                      #15

                      http://www.qtcentre.org/threads/32614-DLL-Deploying-problems

                      Sounds like they succeeded when they put qjpeg4.dll inside a subdirectory called "imageformats"

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        stereomatching
                        wrote on last edited by
                        #16

                        Thanks a lot, the problem solved.

                        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