Skip to content

Commit

Permalink
Fix in-place conversion of certain QImage formats
Browse files Browse the repository at this point in the history
In the copying/transcription of the generic converter to the generic
in-place converter, a test for Format_RGB32 destination format was
mistakenly replaced with test of source format. The result was that a
suboptimal pixel store function was selected, and the resulting image
data could end up with non-0xff in the unused alpha field.

Task-number: QTBUG-132051
Change-Id: If3ebf5fdd7ab6e377c8ad479ea38ce665f922b7c
Reviewed-by: Allan Sandfeld Jensen <[email protected]>
(cherry picked from commit 0ace5ba)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 4d00967)
  • Loading branch information
aavit authored and Qt Cherry-pick Bot committed Dec 14, 2024
1 parent bde5851 commit 933128d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/image/qimage_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
!destLayout->hasAlphaChannel && destLayout->storeFromRGB32) {
// Avoid unnecessary premultiply and unpremultiply when converting from unpremultiplied src format.
fetch = qPixelLayouts[qt_toPremultipliedFormat(data->format)].fetchToARGB32PM;
if (data->format == QImage::Format_RGB32)
if (dst_format == QImage::Format_RGB32)
store = storeRGB32FromARGB32;
else
store = destLayout->storeFromRGB32;
Expand Down

0 comments on commit 933128d

Please sign in to comment.