Revert "Fix comparisons of image with different color spaces"
QImage comparison has always ignored differences in
metadata. Introducing colorspace comparison can break backwards
compatibility, as not all image formats or handlers have colorspace
capability.
This partially reverts commit
733ca2230c.
Fixes: QTBUG-77205
Change-Id: I1d525a9727e84502624cd118f503eec7be306c99
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
bb10
parent
ce99361cc0
commit
ac885a34ec
|
|
@ -3834,9 +3834,7 @@ bool QImage::operator==(const QImage & i) const
|
|||
return false;
|
||||
|
||||
// obviously different stuff?
|
||||
if (i.d->height != d->height || i.d->width != d->width)
|
||||
return false;
|
||||
if (i.d->format != d->format || i.d->colorSpace != d->colorSpace)
|
||||
if (i.d->height != d->height || i.d->width != d->width || i.d->format != d->format)
|
||||
return false;
|
||||
|
||||
if (d->format != Format_RGB32) {
|
||||
|
|
|
|||
|
|
@ -232,8 +232,6 @@ private slots:
|
|||
|
||||
void wideImage();
|
||||
|
||||
void colorspaceEquality();
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
void toWinHBITMAP_data();
|
||||
void toWinHBITMAP();
|
||||
|
|
@ -3620,22 +3618,6 @@ void tst_QImage::wideImage()
|
|||
// Qt6: Test that it actually works on 64bit architectures.
|
||||
}
|
||||
|
||||
void tst_QImage::colorspaceEquality()
|
||||
{
|
||||
QImage image1(10, 10, QImage::Format_RGB32);
|
||||
image1.fill(Qt::red);
|
||||
QImage image2(image1);
|
||||
QCOMPARE(image1, image2);
|
||||
image1.setColorSpace(QColorSpace::SRgbLinear);
|
||||
QVERIFY(image1 != image2);
|
||||
image2.setColorSpace(QColorSpace::SRgbLinear);
|
||||
QVERIFY(image1 == image2);
|
||||
image1.setColorSpace(QColorSpace(QColorSpace::Gamut::DciP3D65, QColorSpace::TransferFunction::Gamma, 2.2f));
|
||||
QVERIFY(image1 != image2);
|
||||
image2.setColorSpace(QColorSpace(QColorSpace::Gamut::DciP3D65, QColorSpace::TransferFunction::Gamma, 2.2001f));
|
||||
QVERIFY(image1 == image2);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
QT_BEGIN_NAMESPACE
|
||||
Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &p, int hbitmapFormat = 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue