Fixed page number detection

This commit is contained in:
Roberto Rosario
2011-03-11 02:59:58 -04:00
parent 1fa8094444
commit bc3d246f34

View File

@@ -107,7 +107,7 @@ def execute_identify(input_filepath, arguments):
return_code = proc.wait()
if return_code != 0:
raise IdentifyError(proc.stderr.readline())
return stdout
return proc.stdout.read()
def cache_cleanup(input_filepath, size, page=0, format='jpg'):
filepath = create_image_cache_filename(input_filepath, size, page, format)
@@ -171,7 +171,8 @@ def convert(input_filepath, size, quality=QUALITY_DEFAULT, cache=True, page=0, f
def get_page_count(input_filepath):
try:
return int(execute_identify(input_filepath, '-format %n'))
except:
except Exception, e:
print 'exception', e
#TODO: send to other page number identifying program
return 1