[fbreader] Handle SVG image element when looking for cover
This commit is contained in:
parent
58d0927e82
commit
4704c68caf
1 changed files with 11 additions and 8 deletions
|
@ -39,16 +39,19 @@ 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) {
|
||||
myCoverReader.myImage =
|
||||
new ZLFileImage(ZLFile(myCoverReader.myPathPrefix + src), 0);
|
||||
interrupt();
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue