From a41fbe067f8aeca0a5a2b8cd47b562f18e8bfcea Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Sun, 23 May 2021 11:31:50 +0200 Subject: [PATCH] Only get pdf page count on pdfs --- src/convertchecker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/convertchecker.cpp b/src/convertchecker.cpp index 0eb81dd..553688e 100644 --- a/src/convertchecker.cpp +++ b/src/convertchecker.cpp @@ -1,6 +1,7 @@ #include "convertchecker.h" #include #include +#include "mimer.h" ConvertChecker::ConvertChecker() { @@ -61,8 +62,8 @@ ConvertChecker* ConvertChecker::instance() quint32 ConvertChecker::pdfPages(QString filename) { quint32 pages = 0; - if(!_pdf) - { + if(!_pdf || (Mimer::instance()->get_type(filename) != Mimer::PDF)) + { // pdfinfo is a bit slow to return on some non-PDFs return pages; }