def set_cover(self, data):
"""Set the cover image to the given data."""
self._cover = 'cover.' + imghdr.what(None, h=data)
with open(str(self.path / 'EPUB/covers' / self._cover), 'wb') as file:
file.write(data)
self._write('cover.xhtml', 'EPUB/cover.xhtml', cover=self._cover)
评论列表
文章目录