From 5cf7fb6b2cc854f074033b97f2c6f8335f92a726 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 16 Jun 2016 12:42:15 +0530 Subject: [PATCH] Edit Book: Check Book: Do not warn if a cover image is not referenced in the text --- src/calibre/ebooks/oeb/polish/check/links.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/oeb/polish/check/links.py b/src/calibre/ebooks/oeb/polish/check/links.py index 821581dd47..2ba40320f1 100644 --- a/src/calibre/ebooks/oeb/polish/check/links.py +++ b/src/calibre/ebooks/oeb/polish/check/links.py @@ -16,6 +16,7 @@ from Queue import Queue, Empty from calibre import browser from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES from calibre.ebooks.oeb.polish.container import OEB_FONTS +from calibre.ebooks.oeb.polish.cover import get_raster_cover_name from calibre.ebooks.oeb.polish.utils import guess_type, actual_case_for_name, corrected_case_for_name from calibre.ebooks.oeb.polish.check.base import BaseError, WARN, INFO @@ -333,6 +334,8 @@ def check_links(container): elif mt in OEB_DOCS and name not in spine_docs: a(UnreferencedDoc(name)) elif (mt in OEB_FONTS or mt.partition('/')[0] in {'image', 'audio', 'video'}) and name not in spine_resources and name != cover_name: + if mt.partition('/')[0] == 'image' and name == get_raster_cover_name(container): + continue a(UnreferencedResource(name)) else: continue