diff --git a/internal/icons.svg b/internal/icons.svg index 7e65878..dbac8a5 100644 --- a/internal/icons.svg +++ b/internal/icons.svg @@ -157,18 +157,6 @@ c4.142,0,7.5-3.357,7.5-7.5S339.642,328,335.5,328z"/> - - - 90 - - - - 180 - - - - 270 - @@ -181,4 +169,25 @@ + + + + + 90 + + + + + + + 180 + + + + + + + 270 + + diff --git a/pa_job_manager.py b/pa_job_manager.py index 3cce31c..6131fbd 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -626,8 +626,8 @@ def RunJob(job): JobRestoreFiles(job) elif job.name == "run_ai_on": JobRunAIOn(job) - elif job.name == "rotate_image": - JobRotateImage(job) + elif job.name == "transform_image": + JobTransformImage(job) else: print("ERROR: Requested to process unknown job type: {}".format(job.name)) # okay, we finished a job, so check for any jobs that are dependant on this and run them... @@ -1281,15 +1281,16 @@ def JobRunAIOn(job): return #################################################################################################################################### -# JobRotateImage(): rotate an image by the amount requested (can also flip horizontal or vertical) +# JobTransformImage(): transform an image by the amount requested (can also flip horizontal or vertical) # TODO: should be JobTransformImage() ;) #################################################################################################################################### -def JobRotateImage(job): +def JobTransformImage(job): JobProgressState( job, "In Progress" ) AddLogForJob(job, f"INFO: Starting rotation/flip of image file...") id=[jex.value for jex in job.extra if jex.name == "id"][0] amt=[jex.value for jex in job.extra if jex.name == "amt"][0] e=session.query(Entry).join(File).filter(Entry.id==id).first() + print( f"JobTransformImage: job={job.id}, id={id}, amt={amt}" ) im = Image.open( e.FullPathOnFS() ) if amt == "fliph": @@ -1300,9 +1301,14 @@ def JobRotateImage(job): out = im.transpose(Image.FLIP_TOP_BOTTOM) else: AddLogForJob(job, f"INFO: Rotating {e.FullPathOnFS()} by {amt} degrees" ) + if im.format == 'JPEG': + im=ImageOps.exif_transpose(im) out = im.rotate(int(amt), expand=True) out.save( e.FullPathOnFS() ) + print( f"JobTransformImage DONE transform: job={job.id}, id={id}, amt={amt}" ) e.file_details.thumbnail, _ , _ = GenThumb( e.FullPathOnFS() ) + e.file_details.hash = md5( job, e.FullPathOnFS() ) + print( f"JobTransformImage DONE thumb: job={job.id}, id={id}, amt={amt}" ) session.add(e) FinishJob(job, "Finished Processesing image rotation/flip") return diff --git a/templates/files.html b/templates/files.html index c207135..7727fcc 100644 --- a/templates/files.html +++ b/templates/files.html @@ -317,7 +317,7 @@ $.contextMenu({ } if( e.currentTarget.getAttribute('type') == 'Image' ) { - item_list['rotate'] = { + item_list['transform'] = { name: "Transform", items: { "r90": { "name" : "Rotate 90 degrees" }, diff --git a/templates/viewer.html b/templates/viewer.html index 8bbdd53..18768b7 100644 --- a/templates/viewer.html +++ b/templates/viewer.html @@ -86,6 +86,7 @@ s+='' s+='' s+='' + s+='' s+='' {% if search_term is defined %} s+='' @@ -271,10 +272,13 @@ $( document ).keydown(function(event) { } }); +console.log('here in viewer: fs = {{OPT.fullscreen}}') var fullscreen=false; {% if OPT.fullscreen=='true' %} +console.log('fs is set') fullscreen=true; ViewImageOrVideo() +console.log('have called view image, etc.') {% endif %} {% endblock script_content %}