created own version of exifautotran (placed into utils), and call it from ./ in non PROD and explciti /code in PROD - it deals with the Samsung created images with invalid SOS which dont autorotate
This commit is contained in:
@@ -33,13 +33,16 @@ if hostname == "lappy":
|
||||
PA_JOB_MANAGER_HOST="localhost"
|
||||
DB_URL = 'postgresql+psycopg2://pa:for_now_pa@localhost:5432/pa'
|
||||
# if we dont set the env or we are explicitly DEV, run web server on localhost & db on mara (port 65432)
|
||||
PA_EXIF_ROTATER = './utils/pa_exifautotran'
|
||||
elif 'FLASK_ENV' not in os.environ or os.environ['FLASK_ENV'] == "development":
|
||||
PA_JOB_MANAGER_HOST="localhost"
|
||||
DB_URL = 'postgresql+psycopg2://pa:for_now_pa@mara.ddp.net:65432/pa'
|
||||
# if we explicitly are on PROD, run web server on localhost (pa_web container) & db on mara (port 5432 on padb container)- only accessed via internal docker ports)
|
||||
PA_EXIF_ROTATER = './utils/pa_exifautotran'
|
||||
elif os.environ['FLASK_ENV'] == "production":
|
||||
PA_JOB_MANAGER_HOST="localhost"
|
||||
DB_URL = 'postgresql+psycopg2://pa:for_now_pa@padb/pa'
|
||||
PA_EXIF_ROTATER = '/code/utils/pa_exifautotran'
|
||||
else:
|
||||
print( "ERROR: I do not know which environment (development, etc.) and which DB (on which host to use)" )
|
||||
exit( -1 )
|
||||
@@ -119,7 +122,7 @@ def GenThumb(fname,auto_rotate):
|
||||
try:
|
||||
if auto_rotate:
|
||||
# run cmdline util to re-orient jpeg (only changes if needed, and does it losslessly)
|
||||
p = subprocess.run(["/usr/bin/exifautotran",fname] )
|
||||
p = subprocess.run([PA_EXIF_ROTATER,fname] )
|
||||
im=Image.open(fname)
|
||||
# if we don't autorotate/touch the original, we still want the thumbnail oriented the right way
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user