diff options
author | Vladimir Belyavsky <belyavskyv@gmail.com> | 2024-03-14 20:44:15 +0300 |
---|---|---|
committer | Vladimir Belyavsky <belyavskyv@gmail.com> | 2024-03-20 00:37:24 +0000 |
commit | 3924c945d17931703cab58fd6f928a6ceda18d35 (patch) | |
tree | f23db260ac7b8e14963f65e987b6a43e3b0842df /src/gui/image/qmovie.cpp | |
parent | 23a906335e0d8a03388bbd73db43682c724d04a7 (diff) |
QMovie: allow only one dimension to be used for scaledSize
In 4c21f728374605ff529aa53c63c3d59517098435 we did this for
QImageReader. So, to support the same for QMovie, we just need
to remove the custom (and very inefficient) scaling for frames.
This should be safe since the underlying QImageReader must ensure
that the returned image matches the scaled size.
[ChangeLog][QtGui][QMovie] Allow only one dimension (width
or height) to be set for the scaled size. In this case, the other
will be calculated automatically based on the original movie size
and maintaining the aspect ratio.
Fixes: QTBUG-115039
Change-Id: I50979a75970c79647dbb8c8b4b121266ba033a63
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image/qmovie.cpp')
-rw-r--r-- | src/gui/image/qmovie.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp index f5fdc2a0ea..435f1dced9 100644 --- a/src/gui/image/qmovie.cpp +++ b/src/gui/image/qmovie.cpp @@ -449,11 +449,7 @@ bool QMoviePrivate::next() } // Image and delay OK, update internal state currentFrameNumber = nextFrameNumber++; - QSize scaledSize = reader->scaledSize(); - if (scaledSize.isValid() && (scaledSize != info.pixmap.size())) - currentPixmap = QPixmap::fromImage( info.pixmap.toImage().scaled(scaledSize) ); - else - currentPixmap = info.pixmap; + currentPixmap = info.pixmap; if (!speed) return true; |