From b2565b82235fb30702c04ad53dc4b28aa85bb70b Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 14 Feb 2011 13:40:48 -0400 Subject: [PATCH] Return 1 as page number is the file format is unknown --- apps/converter/api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/converter/api.py b/apps/converter/api.py index c5dc63bd17..4ee4adcd96 100755 --- a/apps/converter/api.py +++ b/apps/converter/api.py @@ -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'):