diff --git a/generators/comicbook/document.cpp b/generators/comicbook/document.cpp index 72135da87..75c4334a3 100644 --- a/generators/comicbook/document.cpp +++ b/generators/comicbook/document.cpp @@ -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); } }