mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-20 14:45:10 +02:00
Avoid unneccessary tracebacks int he log when a PDF file contains an empty XMP packet
This commit is contained in:
parent
e612637282
commit
5b7ef06e1b
1 changed files with 5 additions and 2 deletions
|
|
@ -317,8 +317,11 @@ def consolidate_metadata(info_mi, info):
|
|||
metadata unless the Info ModDate is never than the XMP MetadataDate. This
|
||||
is the algorithm recommended by the PDF spec. '''
|
||||
try:
|
||||
xmp_mi = metadata_from_xmp_packet(info['xmp_metadata'])
|
||||
except:
|
||||
raw = info['xmp_metadata'].rstrip()
|
||||
if not raw:
|
||||
return info_mi
|
||||
xmp_mi = metadata_from_xmp_packet(raw)
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return info_mi
|
||||
|
|
|
|||
Loading…
Reference in a new issue