Don't create pages for files that are not images

The zip in bug #328182 has one
remotes/origin/KDE/4.11
Albert Astals Cid 12 years ago
parent 9c3165d214
commit 55011e0588
  1. 14
      generators/comicbook/document.cpp

@ -185,11 +185,17 @@ void Document::pages( QVector<Okular::Page*> * pagesVector )
{
QSize pageSize = reader.size();
if ( !pageSize.isValid() ) {
pageSize = reader.read().size();
const QImage i = reader.read();
if ( !i.isNull() )
pageSize = i.size();
}
if ( pageSize.isValid() ) {
pagesVector->replace( count, new Okular::Page( count, pageSize.width(), pageSize.height(), Okular::Rotation0 ) );
mPageMap.append(file);
count++;
} else {
kDebug() << "Ignoring" << file << "doesn't seem to be an image even if QImageReader::canRead returned true";
}
pagesVector->replace( count, new Okular::Page( count, pageSize.width(), pageSize.height(), Okular::Rotation0 ) );
mPageMap.append(file);
count++;
}
}
}

Loading…
Cancel
Save