- # provide a cover by default
- if not cover:
- cover = DefaultEbookCover
- cover_file = NamedTemporaryFile(suffix='.png', delete=False)
- bound_cover = cover(book_info)
- bound_cover.save(cover_file)
-
- if bound_cover.uses_dc_cover:
- if document.book_info.cover_by:
- document.edoc.getroot().set('data-cover-by', document.book_info.cover_by)
- if document.book_info.cover_source:
- document.edoc.getroot().set('data-cover-source', document.book_info.cover_source)
-