From 56d4d97852b37d9d1ca73d5b7f85e3865912f3db Mon Sep 17 00:00:00 2001 From: aavit Date: Wed, 18 Apr 2012 16:15:41 +0200 Subject: 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 --- src/gui/image/qimagereader.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 870784f638..fe14a45dcb 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -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 { -- cgit v1.2.3