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

[backlog] QImageReader::loopCount for gif images is returning -1 for infinite animations and animations that have noo looping at atll

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.6.2
    • 4.6.0
    • Image formats
    • None
    • 381f5ae82cccec3774b68674b4c0e782e9f49f6f

    Description

      Currently it is not possible to differentiate an infinite animation from a gif not being animated at all. The problem is within the documentation. It is not clear what should be returned for a infinite animation (the guess would be -1) and what should be returned for no animations (e.g 0?). The MNG plugin should be checked as well and then the documentation should be adjusted and the GIF plugin be fixed.

      The problem is that in the QGifHandler the loopCnt is initialized to 0 and the loopCount implementation is doing loopCnt - 1; For infinite animations the loopCnt will be set to '0' and for the no animation loopCnt will never be set from within the decoding.

      The proposed patch would be to initialize loopCnt with '1', change loopCount() to check the number of frames read and return -1 if nothing has been read and otherwise return loopCnt - 1;

      Attachments

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

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            holger Holger Freyther
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes