Updated the get_page_count logic to let the converter raise UnknownFileFormat

and let the document model handle the exception, defaulting to one page
count and saving a comment on the document description
This commit is contained in:
Roberto Rosario
2011-08-05 03:48:51 -04:00
parent 3108c33c6d
commit beea100cd9
2 changed files with 13 additions and 8 deletions

View File

@@ -119,12 +119,7 @@ def convert(input_filepath, output_filepath=None, cleanup_files=False, *args, **
def get_page_count(input_filepath):
try:
return backend.get_page_count(input_filepath)
except UnknownFileFormat:
# If converter backend doesn't understand the format return
# 1 as the total page count
return 1
return backend.get_page_count(input_filepath)
def get_document_dimensions(document, *args, **kwargs):