Commit 39fc2a47 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Properly check if a file is a readable image by asking QImageReader.

Reviewed by Albert Astals.
parent f9f65979
......@@ -162,16 +162,11 @@ void Document::extractImageFiles( const QStringList &list )
qSort( files.begin(), files.end(), caseSensitiveNaturalOrderLessThen );
for ( int i = 0; i < files.count(); ++i ) {
const QString lowerFile = files[ i ].toLower();
if ( lowerFile.endsWith( ".gif" ) ||
lowerFile.endsWith( ".jpg" ) ||
lowerFile.endsWith( ".jpeg" ) ||
lowerFile.endsWith( ".png" ) ||
lowerFile.endsWith( ".tif" ) ||
lowerFile.endsWith( ".tiff" ) )
mPageMap.append( files[ i ] );
foreach(const QString &f, files) {
const QImageReader r(f);
if ( r.canRead() )
mPageMap.append(f);
}
}
......
Markdown is supported
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