Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61641

WebP: animations don't loop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.2
    • 5.9.1
    • Image formats
    • None
    • 85ed63f825da57103c68f73af5adeebf67db0da9

    Description

      WebP animations stop running after the first loop, because QWebpHandler::canRead() returns true even if there are no more frames to read. Thus, QMovie attempts to read the next frame when it should jump back to the first frame, ends up reading a null-image, and the animation is interrupted.

      Qt Widgets:

      #include <QtWidgets>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
      
          QLabel label;
          label.resize(300, 300);
          label.setAlignment(Qt::AlignCenter);
          label.setMovie(new QMovie("path/to/busyindicator.webp"));
          label.movie()->start();
          label.show();
      
          return app.exec();
      }
      

      Qt Quick:

      import QtQuick 2.9
      import QtQuick.Window 2.2
      
      Window {
          width: 300
          height: 300
          visible: true
      
          AnimatedImage {
              anchors.centerIn: parent
              source: "file:///path/to/busyindicator.webp"
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes