mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-19 22:44:59 +01:00
Fix #807641 (crash on conversion LRF to epub)
This commit is contained in:
parent
7fbd662e41
commit
2d015ab94b
1 changed files with 3 additions and 2 deletions
|
|
@ -4,8 +4,9 @@
|
|||
|
||||
import sys, array, os, re, codecs, logging
|
||||
|
||||
from calibre import setup_cli_handlers, sanitize_file_name
|
||||
from calibre import setup_cli_handlers
|
||||
from calibre.utils.config import OptionParser
|
||||
from calibre.utils.filenames import ascii_filename
|
||||
from calibre.ebooks.lrf.meta import LRFMetaFile
|
||||
from calibre.ebooks.lrf.objects import get_object, PageTree, StyleObject, \
|
||||
Font, Text, TOCObject, BookAttr, ruby_tags
|
||||
|
|
@ -89,7 +90,7 @@ def to_xml(self, write_files=True):
|
|||
bookinfo += u'<FreeText reading="">%s</FreeText>\n</BookInfo>\n<DocInfo>\n'%(self.metadata.free_text,)
|
||||
th = self.doc_info.thumbnail
|
||||
if th:
|
||||
prefix = sanitize_file_name(self.metadata.title, as_unicode=True)
|
||||
prefix = ascii_filename(self.metadata.title)
|
||||
bookinfo += u'<CThumbnail file="%s" />\n'%(prefix+'_thumbnail.'+self.doc_info.thumbnail_extension,)
|
||||
if write_files:
|
||||
open(prefix+'_thumbnail.'+self.doc_info.thumbnail_extension, 'wb').write(th)
|
||||
|
|
|
|||
Loading…
Reference in a new issue