mirror of https://github.com/kiwix/libkiwix.git
More robust getMediaCount()
This commit is contained in:
parent
2659f323cd
commit
95b32b168d
|
@ -120,20 +120,12 @@ unsigned int Reader::getMediaCount() const
|
||||||
= this->parseCounterMetadata();
|
= this->parseCounterMetadata();
|
||||||
unsigned int counter = 0;
|
unsigned int counter = 0;
|
||||||
|
|
||||||
auto it = counterMap.find("image/jpeg");
|
for (auto it = counterMap.begin(); it != counterMap.end(); ++it) {
|
||||||
if (it != counterMap.end()) {
|
if (it->first.rfind("image/", 0) == 0) {
|
||||||
counter += it->second;
|
counter += it->second;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
it = counterMap.find("image/gif");
|
|
||||||
if (it != counterMap.end()) {
|
|
||||||
counter += it->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
it = counterMap.find("image/png");
|
|
||||||
if (it != counterMap.end()) {
|
|
||||||
counter += it->second;
|
|
||||||
}
|
|
||||||
return counter;
|
return counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue