[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,18 +39,21 @@ private:
XHTMLImageFinder::XHTMLImageFinder(OEBCoverReader &coverReader) : myCoverReader(coverReader) { XHTMLImageFinder::XHTMLImageFinder(OEBCoverReader &coverReader) : myCoverReader(coverReader) {
} }
static const std::string IMG = "img";
void XHTMLImageFinder::startElementHandler(const char *tag, const char **attributes) { 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) { if (IMG == tag) {
const char *src = attributeValue(attributes, "src"); src = attributeValue(attributes, "src");
if (src != 0) { } else if (IMAGE == tag) {
src = attributeValue(attributes, "xlink:href");
}
if (src) {
myCoverReader.myImage = myCoverReader.myImage =
new ZLFileImage(ZLFile(myCoverReader.myPathPrefix + src), 0); new ZLFileImage(ZLFile(myCoverReader.myPathPrefix + src), 0);
interrupt(); interrupt();
} }
} }
}
OEBCoverReader::OEBCoverReader() { OEBCoverReader::OEBCoverReader() {
} }