mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:23:43 +02:00
Fix #5020 (Mobi -> ePub omits some image files)
This commit is contained in:
parent
da8bfe6b02
commit
590dc5b2de
1 changed files with 11 additions and 7 deletions
|
|
@ -4,13 +4,7 @@
|
|||
Read data from .mobi files
|
||||
'''
|
||||
|
||||
import functools
|
||||
import os
|
||||
import re
|
||||
import struct
|
||||
import textwrap
|
||||
import cStringIO
|
||||
import sys
|
||||
import functools, shutil, os, re, struct, textwrap, cStringIO, sys
|
||||
|
||||
try:
|
||||
from PIL import Image as PILImage
|
||||
|
|
@ -620,6 +614,16 @@ def create_opf(self, htmlfile, guide=None, root=None):
|
|||
* opf.cover.split('/'))):
|
||||
opf.cover = None
|
||||
|
||||
cover = opf.cover
|
||||
if cover is not None:
|
||||
cover = cover.replace('/', os.sep)
|
||||
if os.path.exists(cover):
|
||||
ncover = 'images'+os.sep+'calibre_cover.jpg'
|
||||
if os.path.exists(ncover):
|
||||
os.remove(ncover)
|
||||
shutil.copyfile(cover, ncover)
|
||||
opf.cover = ncover.replace(os.sep, '/')
|
||||
|
||||
manifest = [(htmlfile, 'application/xhtml+xml'),
|
||||
(os.path.abspath('styles.css'), 'text/css')]
|
||||
bp = os.path.dirname(htmlfile)
|
||||
|
|
|
|||
Loading…
Reference in a new issue