Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > b489161e8179a429b4f3255503fcb3d7 > files > 5

gwenview-1.4.1-5.1mdv2007.1.src.rpm

Index: imageloader.cpp
===================================================================
--- imageloader.cpp	(revisione 617252)
+++ imageloader.cpp	(copia locale)
@@ -33,6 +33,7 @@
 
 // Local
 #include "cache.h"
+#include "miscconfig.h"
 #include "imageutils/imageutils.h"
 #include "imageutils/jpegcontent.h"
 
@@ -662,12 +663,13 @@
 		Q_ASSERT(!d->mImageFormat.isEmpty());
 		if (d->mImageFormat == "JPEG") {
 			// This is a JPEG, extract orientation and adjust mProcessedImage
-			// if necessary
+			// if necessary according to misc options
 			ImageUtils::JPEGContent content;
 
 			if (content.loadFromData(d->mRawData)) {
-				d->mOrientation = content.orientation();
-				if (d->mOrientation != ImageUtils::NOT_AVAILABLE && d->mOrientation != ImageUtils::NORMAL) {
+				d->mOrientation = content.orientation(); 
+				if (MiscConfig::autoRotateImages() && 
+					d->mOrientation != ImageUtils::NOT_AVAILABLE && d->mOrientation != ImageUtils::NORMAL) {
 					QSize size = content.size();
 					d->mProcessedImage = QImage(size, d->mDecoder.image().depth());
 				}
@@ -680,8 +682,9 @@
 		emit sizeLoaded(d->mProcessedImage.width(), d->mProcessedImage.height());
 	}
 
-	// Apply orientation if necessary
-	if (d->mOrientation != ImageUtils::NOT_AVAILABLE && d->mOrientation != ImageUtils::NORMAL) {
+	// Apply orientation if necessary and if wanted by user settings (misc options)
+	if (MiscConfig::autoRotateImages() && 
+		d->mOrientation != ImageUtils::NOT_AVAILABLE && d->mOrientation != ImageUtils::NORMAL) {
 		// We can only rotate whole images, so copy the loaded rect in a temp
 		// image, rotate the temp image and copy it to mProcessedImage