handled zero length PDF content

This commit is contained in:
Karl Voit 2016-03-12 22:05:58 +01:00
parent bcc6f3adac
commit a27bc42a2e

View file

@ -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':