mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
fix comparison of QImage objects that are in different format
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
af8049be35
commit
3c4fb587da
1 changed files with 13 additions and 1 deletions
|
@ -3802,8 +3802,20 @@ bool QImage::operator==(const QImage & i) const
|
|||
return false;
|
||||
|
||||
// obviously different stuff?
|
||||
if (i.d->height != d->height || i.d->width != d->width || i.d->format != d->format)
|
||||
if (i.d->height != d->height || i.d->width != d->width) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (i.d->format != d->format) {
|
||||
for (int h = 0; h < d->height; h++) {
|
||||
for (int w = 0; w < d->width; w++) {
|
||||
if (pixel(w, h) != i.pixel(w, h)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (d->format != Format_RGB32) {
|
||||
if (d->format >= Format_ARGB32) { // all bits defined
|
||||
|
|
Loading…
Add table
Reference in a new issue