mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Book polishing: Ignore zero byte font files in the ebook instead of erroring out on them when subsetting fonts. Fixes #1395694 [Polish failing with errors](https://bugs.launchpad.net/calibre/+bug/1395694)
This commit is contained in:
parent
a0afd5b2c6
commit
2d8c856e7c
@ -48,7 +48,13 @@ def subset_all_fonts(container, font_stats, report):
|
|||||||
continue
|
continue
|
||||||
with container.open(name, 'r+b') as f:
|
with container.open(name, 'r+b') as f:
|
||||||
raw = f.read()
|
raw = f.read()
|
||||||
|
try:
|
||||||
font_name = get_font_names(raw)[-1]
|
font_name = get_font_names(raw)[-1]
|
||||||
|
except Exception as e:
|
||||||
|
container.log.warning(
|
||||||
|
'Corrupted font: %s, ignoring. Error: %s'%(
|
||||||
|
name, as_unicode(e)))
|
||||||
|
continue
|
||||||
warnings = []
|
warnings = []
|
||||||
container.log('Subsetting font: %s'%(font_name or name))
|
container.log('Subsetting font: %s'%(font_name or name))
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user