Changeset View
Changeset View
Standalone View
Standalone View
lib/thumbnailprovider/thumbnailgenerator.cpp
Context not available. | |||||
22 | #include "thumbnailgenerator.h" | 22 | #include "thumbnailgenerator.h" | ||
---|---|---|---|---|---|
23 | 23 | | |||
24 | // Local | 24 | // Local | ||
25 | #include "imageutils.h" | | |||
26 | #include "jpegcontent.h" | 25 | #include "jpegcontent.h" | ||
27 | #include "gwenviewconfig.h" | 26 | #include "gwenviewconfig.h" | ||
28 | #include "exiv2imageloader.h" | 27 | #include "exiv2imageloader.h" | ||
Context not available. | |||||
61 | { | 60 | { | ||
62 | mImage = QImage(); | 61 | mImage = QImage(); | ||
63 | mNeedCaching = true; | 62 | mNeedCaching = true; | ||
64 | Orientation orientation = NORMAL; | | |||
65 | QImage originalImage; | 63 | QImage originalImage; | ||
66 | QSize originalSize; | 64 | QSize originalSize; | ||
67 | 65 | | |||
Context not available. | |||||
118 | } | 116 | } | ||
119 | 117 | | |||
120 | // If there's jpeg content (from jpg or raw files), try to load an embedded thumbnail, if available. | 118 | // If there's jpeg content (from jpg or raw files), try to load an embedded thumbnail, if available. | ||
121 | // If applyExifOrientation is not set, don't use the | 119 | if (!content.rawData().isEmpty()) { | ||
122 | // embedded thumbnail since it might be rotated differently | | |||
123 | // than the actual image | | |||
124 | if (!content.rawData().isEmpty() && GwenviewConfig::applyExifOrientation()) { | | |||
125 | QImage thumbnail = content.thumbnail(); | 120 | QImage thumbnail = content.thumbnail(); | ||
126 | orientation = content.orientation(); | | |||
127 | 121 | | |||
128 | if (qMax(thumbnail.width(), thumbnail.height()) >= pixelSize) { | 122 | if (qMax(thumbnail.width(), thumbnail.height()) >= pixelSize) { | ||
129 | mImage = thumbnail; | 123 | mImage = std::move(thumbnail); | ||
130 | if (orientation != NORMAL && orientation != NOT_AVAILABLE) { | | |||
131 | QTransform matrix = ImageUtils::transformMatrix(orientation); | | |||
132 | mImage = mImage.transformed(matrix); | | |||
133 | } | | |||
134 | mOriginalWidth = content.size().width(); | 124 | mOriginalWidth = content.size().width(); | ||
135 | mOriginalHeight = content.size().height(); | 125 | mOriginalHeight = content.size().height(); | ||
136 | return true; | 126 | return true; | ||
Context not available. |