Commit d1486a5c authored by Fred Fonkle's avatar Fred Fonkle Committed by Albert Astals Cid
Browse files

Fix for OpenEXR thumbnailer MaximumSize dimension bug 433660

The MaximumSize restriction for files without a preview image now correctly reads a qint64 value so it works with large numbers as well.

Updated the test so that if no MaximumSize is given qint64_max (No Limit) a thumbnail will be created.
parent 5ccff726
......@@ -29,6 +29,8 @@
#include <ksharedconfig.h>
#include <kconfiggroup.h>
#include <limits>
extern "C"
Q_DECL_EXPORT ThumbCreator *new_creator()
......@@ -63,8 +65,8 @@ bool EXRCreator::create(const QString &path, int, int, QImage &img)
qCDebug(KIO_THUMBNAIL_EXR_LOG) << "EXRcreator - using original image";
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup configGroup( config, "PreviewSettings" );
unsigned long long maxSize = configGroup.readEntry( "MaximumSize", 1024*1024 /* 1MB */ );
unsigned long long fileSize = QFile( path ).size();
const qint64 maxSize = configGroup.readEntry( "MaximumSize", std::numeric_limits<qint64>::max() );
const qint64 fileSize = QFile( path ).size();
if ( (fileSize > 0) && (fileSize < maxSize) ) {
if (!img.load( path )) {
return false;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment