Only get pdf page count on pdfs

This commit is contained in:
Anton Thomasson 2021-05-23 11:31:50 +02:00
parent 5aa2afcc63
commit a41fbe067f

View file

@ -1,6 +1,7 @@
#include "convertchecker.h" #include "convertchecker.h"
#include <QProcess> #include <QProcess>
#include <QtDebug> #include <QtDebug>
#include "mimer.h"
ConvertChecker::ConvertChecker() ConvertChecker::ConvertChecker()
{ {
@ -61,8 +62,8 @@ ConvertChecker* ConvertChecker::instance()
quint32 ConvertChecker::pdfPages(QString filename) quint32 ConvertChecker::pdfPages(QString filename)
{ {
quint32 pages = 0; 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; return pages;
} }