Copy image offset in copyMetadata

Making it be carried more consistently.

Change-Id: I8d2da1264a59febbd44bbcff798b647ec2813bb0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 2d2fae48637d0aaa77cdd7dd413c40efec27a8a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Allan Sandfeld Jensen 2024-04-17 17:17:57 +02:00 committed by Qt Cherry-pick Bot
parent acff474a2b
commit d8dbe0f352

View File

@ -1147,9 +1147,10 @@ static void copyPhysicalMetadata(QImageData *dst, const QImageData *src)
static void copyMetadata(QImageData *dst, const QImageData *src)
{
// Doesn't copy colortable and alpha_clut, or offset.
// Doesn't copy colortable and alpha_clut.
copyPhysicalMetadata(dst, src);
dst->text = src->text;
dst->offset = src->offset;
dst->colorSpace = src->colorSpace;
}
@ -1214,7 +1215,6 @@ QImage Q_TRACE_INSTRUMENT(qtgui) QImage::copy(const QRect& r) const
} else
memcpy(image.bits(), bits(), d->nbytes);
image.d->colortable = d->colortable;
image.d->offset = d->offset;
image.d->has_alpha_clut = d->has_alpha_clut;
copyMetadata(image.d, d);
return image;
@ -1303,7 +1303,6 @@ QImage Q_TRACE_INSTRUMENT(qtgui) QImage::copy(const QRect& r) const
}
copyMetadata(image.d, d);
image.d->offset = offset();
image.d->has_alpha_clut = d->has_alpha_clut;
return image;
}
@ -2203,7 +2202,6 @@ QImage QImage::convertToFormat_helper(Format format, Qt::ImageConversionFlags fl
QIMAGE_SANITYCHECK_MEMORY(image);
image.d->offset = offset();
copyMetadata(image.d, d);
converter(image.d, d, flags);