mirror of
https://github.com/novoid/guess-filename.py.git
synced 2026-02-16 13:24:15 +00:00
handled zero length PDF content
This commit is contained in:
parent
bcc6f3adac
commit
a27bc42a2e
1 changed files with 5 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Time-stamp: <2016-03-12 15:20:56 vk>
|
||||
# Time-stamp: <2016-03-12 22:05:40 vk>
|
||||
|
||||
# TODO:
|
||||
# * add -i (interactive) where user gets asked if renaming should be done (per file)
|
||||
|
|
@ -429,6 +429,10 @@ class GuessFilename(object):
|
|||
logging.error('Could not determine number of pages of PDF content! (skipping content analysis)')
|
||||
return False
|
||||
|
||||
if len(content) == 0:
|
||||
logging.warning('Could read PDF file content but it is empty (skipping content analysis)')
|
||||
return False
|
||||
|
||||
datetimestr, basefilename, tags, extension = self.split_filename_entities(basename)
|
||||
|
||||
if extension.lower() != 'pdf':
|
||||
|
|
|
|||
Loading…
Reference in a new issue