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. How to load a webp in QImage?
QtWS25 Last Chance

How to load a webp in QImage?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 718 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.
  • J Offline
    J Offline
    jeff1209
    wrote on 20 Jan 2024, 14:11 last edited by
    #1

    I have a simple project that displays an image picked by the user. In the process, I run:

    QImage image;
    image.load(imagePath);
    

    But QImage remains with an "invalid" image. It does work for other image formats, like png and jpg.

    As I understand it, webp is supported by something called "Qt Image Formats", that's external to QtGui, but looking at the plugins/imageformats folder, there is no webp dll, only a qwebp.pdb file.

    How can I acquire this dll? Or am I missing the mark somewhere?

    C 1 Reply Last reply 20 Jan 2024, 14:33
    0
    • J jeff1209
      20 Jan 2024, 14:11

      I have a simple project that displays an image picked by the user. In the process, I run:

      QImage image;
      image.load(imagePath);
      

      But QImage remains with an "invalid" image. It does work for other image formats, like png and jpg.

      As I understand it, webp is supported by something called "Qt Image Formats", that's external to QtGui, but looking at the plugins/imageformats folder, there is no webp dll, only a qwebp.pdb file.

      How can I acquire this dll? Or am I missing the mark somewhere?

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 20 Jan 2024, 14:33 last edited by
      #2

      @jeff1209 said in How to load a webp in QImage?:

      Or am I missing the mark somewhere?

      Yes, in the Qt online installer you forgot to install the Qt image formats for your Qt version.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      J 1 Reply Last reply 20 Jan 2024, 15:14
      2
      • C Christian Ehrlicher
        20 Jan 2024, 14:33

        @jeff1209 said in How to load a webp in QImage?:

        Or am I missing the mark somewhere?

        Yes, in the Qt online installer you forgot to install the Qt image formats for your Qt version.

        J Offline
        J Offline
        jeff1209
        wrote on 20 Jan 2024, 15:14 last edited by
        #3

        @Christian-Ehrlicher That was it, thanks!

        1 Reply Last reply
        1
        • J jeff1209 has marked this topic as solved on 20 Jan 2024, 15:14

        1/3

        20 Jan 2024, 14:11

        • Login

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