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. QPixmap.loadFromData() fails

QPixmap.loadFromData() fails

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 5 Posters 1.2k 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
    gkavrecic
    wrote on last edited by
    #1

    I'm reading images from a web cam as JPGs.
    It was working on devel machine, but it fails on user's pc.

    If I store the received QByteArray in a *.PNG file is displayed correctly.

    Any advice how to approach the issue is welcome.

    KroMignonK J.HilkJ 2 Replies Last reply
    0
    • G gkavrecic

      I'm reading images from a web cam as JPGs.
      It was working on devel machine, but it fails on user's pc.

      If I store the received QByteArray in a *.PNG file is displayed correctly.

      Any advice how to approach the issue is welcome.

      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by
      #2

      @gkavrecic It seems that the end user web cam is configured to send PNG not JPG!

      So, change web cam configuration or you code the load load as PNG not JPG

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      1 Reply Last reply
      0
      • G gkavrecic

        I'm reading images from a web cam as JPGs.
        It was working on devel machine, but it fails on user's pc.

        If I store the received QByteArray in a *.PNG file is displayed correctly.

        Any advice how to approach the issue is welcome.

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @gkavrecic
        do not let the QImageReader guess, and specify the format during loadFromData call


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        G 1 Reply Last reply
        0
        • G Offline
          G Offline
          gkavrecic
          wrote on last edited by
          #4

          Sorry for not specifying this:
          The same HW is used.
          It is the same cam used and same software.
          Currently I've added to write qbytearray to a file when the conversion loadFromData fails.
          It would probably work if I change it to *.JPG

          1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @gkavrecic
            do not let the QImageReader guess, and specify the format during loadFromData call

            G Offline
            G Offline
            gkavrecic
            wrote on last edited by
            #5

            @J.Hilk
            I tought of this, but what could influence the different bahaviour?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Since it's not working on the user's pc, how do you provide him with the executable ?

              Did you forget to bundle the plugins with it ?

              From the look of it, you are missing the JPEG image format plugin.

              PNG is built-in.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              G 1 Reply Last reply
              2
              • SGaistS SGaist

                Hi,

                Since it's not working on the user's pc, how do you provide him with the executable ?

                Did you forget to bundle the plugins with it ?

                From the look of it, you are missing the JPEG image format plugin.

                PNG is built-in.

                G Offline
                G Offline
                gkavrecic
                wrote on last edited by
                #7

                @SGaist, if you mean static or shared libs - shared
                It might be that some DLL is missing.
                Would you propose one?

                jsulmJ 1 Reply Last reply
                0
                • G gkavrecic

                  @SGaist, if you mean static or shared libs - shared
                  It might be that some DLL is missing.
                  Would you propose one?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @gkavrecic @SGaist means JPEG plug-in delivered with Qt (check plugins/imageformats directory in your Qt setup).

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  2
                  • G Offline
                    G Offline
                    gkavrecic
                    wrote on last edited by
                    #9

                    It was missing the qjpeg.dll
                    Thanks for the hints

                    1 Reply Last reply
                    1

                    • Login

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