mirror of https://github.com/kiwix/libkiwix.git
Book::Illustration got dimensions
This commit is contained in:
parent
5263f6880c
commit
f4bc3c8ced
|
@ -48,6 +48,8 @@ class Book
|
||||||
{
|
{
|
||||||
friend class Book;
|
friend class Book;
|
||||||
public:
|
public:
|
||||||
|
uint16_t width = 48;
|
||||||
|
uint16_t height = 48;
|
||||||
std::string mimeType;
|
std::string mimeType;
|
||||||
std::string url;
|
std::string url;
|
||||||
|
|
||||||
|
|
|
@ -226,8 +226,12 @@ void Book::setPath(const std::string& path)
|
||||||
|
|
||||||
const Book::Illustration& Book::getDefaultIllustration() const
|
const Book::Illustration& Book::getDefaultIllustration() const
|
||||||
{
|
{
|
||||||
assert(m_illustrations.size() == 1);
|
for ( const auto& ilPtr : m_illustrations ) {
|
||||||
return *m_illustrations.front();
|
if (ilPtr->width == 48 && ilPtr->height == 48) {
|
||||||
|
return *ilPtr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::runtime_error("No default illustration");
|
||||||
}
|
}
|
||||||
|
|
||||||
Book::Illustration& Book::getMutableDefaultIllustration()
|
Book::Illustration& Book::getMutableDefaultIllustration()
|
||||||
|
|
Loading…
Reference in New Issue