Fix workaround for image readers that can scale but not clip

If both scaling and clipping was requested from an image reader that
only supports scaling, the code failed to apply the intended
workaround (i.e. read normal and do clipping and scaling afterwards).
Ref. the comment just above about "Only enable the ScaledSize option if
..."

Change-Id: I273edba60bf9f785f2082aa8f236505ec3ce0776
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
bb10
aavit 2012-04-18 16:15:41 +02:00 committed by Qt by Nokia
parent 878a01b2d1
commit 56d4d97852
1 changed files with 1 additions and 5 deletions

View File

@ -1197,11 +1197,7 @@ bool QImageReader::read(QImage *image)
}
}
} else {
if (d->handler->supportsOption(QImageIOHandler::ScaledSize) && d->scaledSize.isValid()) {
// in this case, there's nothing we can do. if the
// plugin supports scaled size but not ClipRect, then
// we have to ignore ClipRect."
if (d->handler->supportsOption(QImageIOHandler::ScaledSize) && d->scaledSize.isValid() && d->clipRect.isNull()) {
if (d->handler->supportsOption(QImageIOHandler::ScaledClipRect) && !d->scaledClipRect.isNull()) {
// nothing to do (ClipRect is ignored!)
} else {