remove face data after transform (BUG-142), also only reset viewing image if we are viewing, and remove debugs

This commit is contained in:
2025-10-28 22:16:26 +11:00
parent bc2d4384c9
commit 76b0745cc3
4 changed files with 11 additions and 7 deletions

1
BUGs
View File

@@ -1,6 +1,5 @@
### Next: 146 ### Next: 146
BUG-143: if I skip next fast enough in files_ip, it can get the warning about changes to entry list... (would have though I disabled next page until loaded) BUG-143: if I skip next fast enough in files_ip, it can get the warning about changes to entry list... (would have though I disabled next page until loaded)
BUG-142: after transforming, the face data is still in the old spots, really should delete it - any change invalidates the face match
BUG-140: When db is restarted underneath PA, it crashes job mgr... It should just accept timeouts, and keep trying to reconnect every 2? mins BUG-140: When db is restarted underneath PA, it crashes job mgr... It should just accept timeouts, and keep trying to reconnect every 2? mins
BUG-125: when an image is highlighted, then post the contextmenu on a different image - the highlight does not move to the new image BUG-125: when an image is highlighted, then post the contextmenu on a different image - the highlight does not move to the new image
and the selected menu function processes the original or the new depending on the way the code works. and the selected menu function processes the original or the new depending on the way the code works.

View File

@@ -682,7 +682,6 @@ function getPage(pageNumber, successCallback, viewingIdx=0)
$('#ra').prop('disabled', true) $('#ra').prop('disabled', true)
const startIndex = (pageNumber - 1) * OPT.how_many; const startIndex = (pageNumber - 1) * OPT.how_many;
const endIndex = startIndex + OPT.how_many; const endIndex = startIndex + OPT.how_many;
console.log('pageNumber is: ' + pageNumber + ', about to make pageList from si=' +startIndex + ', to ei=' + endIndex )
pageList = entryList.slice(startIndex, endIndex); pageList = entryList.slice(startIndex, endIndex);
// set up data to send to server to get the entry data for entries in pageList // set up data to send to server to get the entry data for entries in pageList

View File

@@ -2,7 +2,6 @@
// can only have 1 ammendment per image, its grayed out for other changes // can only have 1 ammendment per image, its grayed out for other changes
function removeAmendment( id ) function removeAmendment( id )
{ {
console.log( 'removing amendment for: ' + id )
document.amendments=document.amendments.filter(obj => obj.eid !== id) document.amendments=document.amendments.filter(obj => obj.eid !== id)
} }
@@ -11,11 +10,16 @@ function removeAmendment( id )
function handleTransformImageJobCompleted(job, entry) function handleTransformImageJobCompleted(job, entry)
{ {
removeAmendment( entry.id ) removeAmendment( entry.id )
// update viewer and files* views, in case we view/go up without a new page load // update viewer if we are viewing an image
// force reload with timestamped version of im.src if( document.viewing )
im.src=im.src + '?t=' + new Date().getTime(); {
DrawImg() // force reload with timestamped version of im.src
im.src=im.src + '?t=' + new Date().getTime();
DrawImg()
}
// ALWAYS update files* div as we could go back to this from a viewer, and
// the thumbnail needs the updated data
idx = entryList.indexOf(entry.id) idx = entryList.indexOf(entry.id)
// replace data for this entry now its been transformed // replace data for this entry now its been transformed
document.entries[idx]=entry document.entries[idx]=entry

View File

@@ -1925,6 +1925,8 @@ def JobTransformImage(job):
e.file_details.hash = md5( job, e ) e.file_details.hash = md5( job, e )
PAprint( f"JobTransformImage DONE thumb: job={job.id}, id={id}, amt={amt}" ) PAprint( f"JobTransformImage DONE thumb: job={job.id}, id={id}, amt={amt}" )
session.add(e) session.add(e)
# any faces in this file are no longer valid, remove them
session.query(FaceFileLink).filter(FaceFileLink.file_eid==e.id).delete()
removeEntryAmendment( job, id ) removeEntryAmendment( job, id )
FinishJob(job, "Finished Processesing image rotation/flip") FinishJob(job, "Finished Processesing image rotation/flip")