Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15
-
None
Description
I want to show the current frame and frameCount of an AnimatedImage (.gif).
During the first playback of the gif the frameCount is 0.
After that the frameCount changes to the actual number of frames but the corresponding signal is never emitted, so the bindings are not updated.
As a workaround I have the following binding:
onCurrentFrameChanged: seeker.duration = image.frameCount
I tried to fix it, but QMovie doesn't seem to have any relevant signals.
What worked for me is this (which is obviously not optimal since it runs every frame):
------------------- src/quick/items/qquickanimatedimage.cpp ------------------- index 9de48cbf5f..0a0dc4d277 100644 @@ -471,6 +471,10 @@ void QQuickAnimatedImage::movieUpdate() if (d->movie) { d->setPixmap(*d->infoForCurrentFrame(qmlEngine(this))); emit QQuickImageBase::currentFrameChanged(); + if (d->frameCount != d->movie->frameCount()) { + d->frameCount = d->movie->frameCount(); + emit QQuickImageBase::frameCountChanged(); + } } }