summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats
diff options
context:
space:
mode:
authorElvis Lee <kwangwoong.lee@lge.com>2017-04-26 12:29:24 +0900
committerDominik Holland <dominik.holland@qt.io>2020-06-11 09:10:01 +0200
commitab6fd84c62ff4a72696798dcf6598dd6a44389f6 (patch)
tree07a11e3be0eeaaccf3b404238fd3bd1405779feb /src/plugins/imageformats
parentc549ff3fd4e0ae770e6728f541db2a257d4eabd8 (diff)
Make it possible to avoid loading comments from JPEG and PNG files
Skip reading JPEG and PNG comments information from the header to save the memory. This can now be configured through the feature system. Change-Id: I3744312f69aa3201d5188776cbd99fe690b75d32 Task-number: QTBUG-83123 Pick-to: 5.15 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/plugins/imageformats')
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index fed585a82e..25b0c625fd 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -956,6 +956,7 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device)
for (jpeg_saved_marker_ptr marker = info.marker_list; marker != nullptr; marker = marker->next) {
if (marker->marker == JPEG_COM) {
+#ifndef QT_NO_IMAGEIO_TEXT_LOADING
QString key, value;
QString s = QString::fromUtf8((const char *)marker->data, marker->data_length);
int index = s.indexOf(QLatin1String(": "));
@@ -971,6 +972,7 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device)
description += key + QLatin1String(": ") + value.simplified();
readTexts.append(key);
readTexts.append(value);
+#endif
} else if (marker->marker == JPEG_APP0 + 1) {
exifData.append((const char*)marker->data, marker->data_length);
} else if (marker->marker == JPEG_APP0 + 2) {