Skip to content
Snippets Groups Projects
Commit 6804f9a0 authored by Marco De Donno's avatar Marco De Donno
Browse files

Add the resolution set in the 'image_serve' function

parent 8eb31c1e
No related branches found
No related tags found
No related merge requests found
......@@ -116,13 +116,17 @@ def image_serve( table, image_id, submission_id ):
sql = "SELECT data, uuid FROM {} WHERE uuid = %s".format( table )
p = ( image_id, )
elif table in [ "files", "thumbnails" ]:
elif table == "files":
sql = "SELECT data, uuid, resolution, format FROM {} WHERE uuid = %s".format( table )
p = ( image_id, )
elif table == "thumbnails":
sql = "SELECT data, uuid, format FROM {} WHERE uuid = %s".format( table )
p = ( image_id, )
elif table == "tenprint_cards":
image_id, t = image_id
sql = "SELECT image_{} as data, id as uuid FROM {} WHERE id = %s".format( t, table )
sql = "SELECT image_{} as data, id as uuid, image_resolution AS resolution FROM {} WHERE id = %s".format( t, table )
p = ( image_id, )
need_to_decrypt = False
......@@ -158,6 +162,9 @@ def image_serve( table, image_id, submission_id ):
else:
img = str2img( img )
if "resolution" in data:
img.info[ "dpi" ] = ( data[ "resolution" ], data[ "resolution" ] )
current_app.logger.debug( "image: {}".format( img ) )
return img, rid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment