[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,16 +39,19 @@ 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) {
myCoverReader.myImage = src = attributeValue(attributes, "xlink:href");
new ZLFileImage(ZLFile(myCoverReader.myPathPrefix + src), 0); }
interrupt(); if (src) {
} myCoverReader.myImage =
new ZLFileImage(ZLFile(myCoverReader.myPathPrefix + src), 0);
interrupt();
} }
} }