From 55d48519c9132c6d213f2e733bcd806e3b1f05fb Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 11 Oct 2015 08:16:28 +0200 Subject: Change image size calculation Use ImageMagick::Image::ping to determine the size of an image, but only if the file size is < 400kb to prevent the impression of a deadlock. --- smdirwatcher.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'smdirwatcher.cpp') diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp index 79bce7c..2bcaff3 100644 --- a/smdirwatcher.cpp +++ b/smdirwatcher.cpp @@ -75,8 +75,12 @@ QList SmDirWatcher::generalData(const QString &path){ QVariantMap m = Helper::ffmpegData(fi.absoluteFilePath()); data << m.value("duration") << m.value("bit_rate"); }else if(mime.startsWith("image")){ - QVariant picSize = Helper::picSize(fi.absoluteFilePath()); - data << picSize << QVariant(); + if(fi.size() > 1024*400){ //skip images bigger than 300 kb + data << "skipped" << QVariant(); + }else{ + QVariant picSize = Helper::picSize(fi.absoluteFilePath()); + data << picSize << QVariant(); + } }else{ data << QVariant() << QVariant(); } -- cgit v1.2.3-70-g09d2