Skip to content

Commit 050906c

Browse files
authored
Merge pull request #1226 from kiwix/new_illustrations_api
Switched to the new illustrations API
2 parents 2a858dc + f5e35b4 commit 050906c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/book.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ void Book::update(const zim::Archive& archive) {
8282
m_size = static_cast<uint64_t>(getArchiveFileSize(archive)) << 10;
8383

8484
m_illustrations.clear();
85-
for ( const auto illustrationSize : archive.getIllustrationSizes() ) {
85+
for ( const auto& illustrationInfo : archive.getIllustrationInfos() ) {
8686
const auto illustration = std::make_shared<Illustration>();
87-
const zim::Item illustrationItem = archive.getIllustrationItem(illustrationSize);
88-
illustration->width = illustration->height = illustrationSize;
87+
const zim::Item illustrationItem = archive.getIllustrationItem(illustrationInfo);
88+
illustration->width = illustrationInfo.width;
89+
illustration->height = illustrationInfo.height;
8990
illustration->mimeType = illustrationItem.getMimetype();
9091
illustration->data = illustrationItem.getData();
9192
// NOTE: illustration->url is left uninitialized

0 commit comments

Comments
 (0)