diff options
author | Arno <arno@disconnect.de> | 2015-10-11 08:16:28 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2015-10-11 08:16:28 +0200 |
commit | 55d48519c9132c6d213f2e733bcd806e3b1f05fb (patch) | |
tree | ccaec3219ebfb05ea9a742398ee5e4c47713eae5 /smdirwatcher.cpp | |
parent | b8c44e336b596aa45f4fd4054353912b73b71e66 (diff) | |
download | SheMov-55d48519c9132c6d213f2e733bcd806e3b1f05fb.tar.gz SheMov-55d48519c9132c6d213f2e733bcd806e3b1f05fb.tar.bz2 SheMov-55d48519c9132c6d213f2e733bcd806e3b1f05fb.zip |
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.
Diffstat (limited to 'smdirwatcher.cpp')
-rw-r--r-- | smdirwatcher.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp index 79bce7c..2bcaff3 100644 --- a/smdirwatcher.cpp +++ b/smdirwatcher.cpp @@ -75,8 +75,12 @@ QList<QVariant> 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(); } |