mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Proper fix for EPUB files without title pages
This commit is contained in:
parent
3ce1c8bd63
commit
1e57c4180e
@ -26,7 +26,9 @@ from calibre.ebooks.oeb.base import (
|
|||||||
)
|
)
|
||||||
from calibre.ebooks.oeb.iterator.book import extract_book
|
from calibre.ebooks.oeb.iterator.book import extract_book
|
||||||
from calibre.ebooks.oeb.polish.container import Container as ContainerBase
|
from calibre.ebooks.oeb.polish.container import Container as ContainerBase
|
||||||
from calibre.ebooks.oeb.polish.cover import find_cover_image, set_epub_cover
|
from calibre.ebooks.oeb.polish.cover import (
|
||||||
|
find_cover_image, find_cover_page, set_epub_cover
|
||||||
|
)
|
||||||
from calibre.ebooks.oeb.polish.css import transform_css
|
from calibre.ebooks.oeb.polish.css import transform_css
|
||||||
from calibre.ebooks.oeb.polish.toc import get_landmarks, get_toc
|
from calibre.ebooks.oeb.polish.toc import get_landmarks, get_toc
|
||||||
from calibre.ebooks.oeb.polish.utils import extract, guess_type
|
from calibre.ebooks.oeb.polish.utils import extract, guess_type
|
||||||
@ -267,10 +269,12 @@ class Container(ContainerBase):
|
|||||||
'''
|
'''
|
||||||
blank = {'q': False}
|
blank = {'q': False}
|
||||||
if input_fmt == 'epub':
|
if input_fmt == 'epub':
|
||||||
|
if not find_cover_page(self) and not find_cover_image(self):
|
||||||
|
blank['q'] = True
|
||||||
|
|
||||||
def cover_path(action, data):
|
def cover_path(action, data):
|
||||||
if action == 'write_image':
|
if action == 'write_image':
|
||||||
data.write(BLANK_JPEG)
|
data.write(BLANK_JPEG)
|
||||||
blank['q'] = True
|
|
||||||
raster_cover_name, titlepage_name = set_epub_cover(self, cover_path, (lambda *a: None), options={'template':templ})
|
raster_cover_name, titlepage_name = set_epub_cover(self, cover_path, (lambda *a: None), options={'template':templ})
|
||||||
else:
|
else:
|
||||||
raster_cover_name = find_cover_image(self, strict=True)
|
raster_cover_name = find_cover_image(self, strict=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user