Return 1 as page number is the file format is unknown

This commit is contained in:
Roberto Rosario
2011-02-14 13:40:48 -04:00
parent c0a00848c6
commit b2565b8223

View File

@@ -151,9 +151,13 @@ def get_page_count(input_filepath):
status, error_string, output = execute_identify(input_filepath, '-format %n')
if status:
errors = get_errors(error_string)
raise ConvertError(status, errors)
return 1
#raise ConvertError(status, errors)
finally:
return int(output)
if output:
return int(output)
else:
return 1
#TODO: slugify OCR_OPTIONS and add to file name to cache
def convert_document_for_ocr(document, page=0, format='tif'):