[fbreader] Handle SVG image element when looking for cover

This commit is contained in:
Slava Monich 2015-12-13 18:25:09 +03:00
parent 58d0927e82
commit 4704c68caf

View file

@ -39,17 +39,20 @@ private:
XHTMLImageFinder::XHTMLImageFinder(OEBCoverReader &coverReader) : myCoverReader(coverReader) {
}
static const std::string IMG = "img";
void XHTMLImageFinder::startElementHandler(const char *tag, const char **attributes) {
static const std::string IMG = "img";
static const std::string IMAGE = "image";
const char *src = NULL;
if (IMG == tag) {
const char *src = attributeValue(attributes, "src");
if (src != 0) {
src = attributeValue(attributes, "src");
} else if (IMAGE == tag) {
src = attributeValue(attributes, "xlink:href");
}
if (src) {
myCoverReader.myImage =
new ZLFileImage(ZLFile(myCoverReader.myPathPrefix + src), 0);
interrupt();
}
}
}
OEBCoverReader::OEBCoverReader() {