Skip to content
Commits on Source (2)
......@@ -1310,6 +1310,16 @@ def image_auto_detect_format_raw( cnm_uuid, file_uuid, fpc = 0 ):
img = utils.images.patch_image_to_web_standard( img )
# Image resampling to 1000dpi
res, _ = img.info[ 'dpi' ]
if res != 1000:
fac = 1000 / float( res )
w, h = img.size
img = img.resize( ( int( w * fac ), int( h * fac ) ), Image.BICUBIC )
img.info[ 'dpi' ] = ( 1000, 1000 )
# Return the image
buff = utils.images.pil2buffer( img, "TIFF" )
return send_file(
buff,
......
......@@ -75,6 +75,16 @@ def image_file_serve_raw( file_id = None ):
if not hasattr( img, "use_load_libtiff" ):
img.use_load_libtiff = True
# Image resampling to 1000dpi
res, _ = img.info[ 'dpi' ]
if res != 1000:
fac = 1000 / float( res )
w, h = img.size
img = img.resize( ( int( w * fac ), int( h * fac ) ), Image.BICUBIC )
img.info[ 'dpi' ] = ( 1000, 1000 )
# Return the image
buff = utils.images.pil2buffer( img, "TIFF" )
return send_file(
buff,
......