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

Reviewed by Albert Astals.
remotes/origin/textfind-and-transparency
Aleix Pol 15 years ago
parent f9f65979f5
commit 39fc2a471e
  1. 15
      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);
}
}

Loading…
Cancel
Save