feat(archive): convert sequences to JPEG, TIFF-16 or linear DNG after import

Owner review 2, R7 asks for mass conversion after import on the web panel and the desktop,
with a choice at every run between Replace and New sequence. This is the engine and the
server API both UIs build on.

- Core/Conversion: ConvertOptions (JPEG 4:4:4 at quality 1-100, default 95; TIFF-16 sRGB
  Deflate with the predictor; linear DNG, the archival choice; converted names keep the
  stem and take the target's extension in the old one's case). FrameConverter decodes at
  the native tier only, encodes with the in-house writers, writes Exif from the sidecar
  (capture time to the tick, offset, exposure) and the original (camera, serial, lens,
  modes, GPS), hashes the bytes as made, writes atomically and verifies: read back, the
  metadata again, a decode by the server's decoders. ExifWriter now writes the exposure
  program, metering mode, flash and white balance. ConvertPlanner: convertible frames,
  skips with reasons, size estimates per pixel, the plan's space and fingerprint.
- FrameTrash.ReplaceAsync swaps the files of frames in place: same ids and indices, the old
  files and their XMP companions into one Replaced trash entry (records, replacement
  hashes, a copy of analysis.json), tombstones aliasing old content to new, proxies of the
  swapped frames dropped, under .chronos/replace.pending.json, which the next writer undoes
  or completes. Restoring a Replaced entry swaps back while every converted frame is
  unchanged (the converted files become a Replaced entry in turn), else the originals come
  back as a new sequence.
- MassConverter and JobKind.Convert (19): the dry run (busy, offline, unreadable, space
  against ArchiveServiceOptions.FreeSpace), stage A converting into
  staging/convert-<job>/ in parallel with each source re-hashed and each staged file
  appended to journal/convert-<job>.staged, stage B per sequence all or nothing under the
  lease at the planned frames version: Replace, or a new sequence through the ingest with
  the source's tags, rating, notes and project. Resumes keep verified staged files; a
  sequence changed, busy or with a failed photo is left as it was and fails the job at the
  end, the journal kept for a retry.
- POST /api/v1/archive/convert: dry run with the plan, its space line and fingerprint, or a
  202 convert job; formats the server cannot read at full resolution are skipped as
  convert_on_pc; validated, audited (archive_converted), sequenceChanged converted/created.
  The server measures the space volume for the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 809210d924cfc3f597ecdea26106fb3ff62d3762)
(cherry picked from commit e13d4c0bb1bd9441933b6f3e5b6220e865a7228c)
This commit is contained in:
Alby96 committed 2026-10-27 22:01:23 +01:00
1 parent d518e87733
commit 0e52929274
34 files changed
+3519 -32

No files matched your search

+1
View File
@@ -133,6 +133,7 @@
<data name="Admin.Job.Kind.Adopt" xml:space="preserve"><value>Adopt</value></data>
<data name="Admin.Job.Kind.Backup" xml:space="preserve"><value>Backup</value></data>
<data name="Admin.Job.Kind.Cleanup" xml:space="preserve"><value>Clean-up</value></data>
<data name="Admin.Job.Kind.Convert" xml:space="preserve"><value>Convert</value></data>
<data name="Admin.Job.Kind.DeepAnalyse" xml:space="preserve"><value>Deep analysis</value></data>
<data name="Admin.Job.Kind.Duplicates" xml:space="preserve"><value>Duplicates</value></data>
<data name="Admin.Job.Kind.EmptyTrash" xml:space="preserve"><value>Empty trash</value></data>
+23
View File
@@ -35,6 +35,19 @@
<data name="Archive.Confirm.Remove" xml:space="preserve"><value>Remove row</value></data>
<data name="Archive.Confirm.RemoveHeading" xml:space="preserve"><value>Remove {0} from the index?</value><comment>long</comment></data>
<data name="Archive.Confirm.RemoveMessage" xml:space="preserve"><value>Its sidecar is gone. Only the index row is removed; no file is deleted.</value><comment>long</comment></data>
<data name="Archive.Convert.Blocked.Busy" xml:space="preserve"><value>A job is working on this sequence; convert it once the job is done.</value><comment>long: why a sequence is not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Blocked.FramesChanged" xml:space="preserve"><value>The sequence changed after the plan; review the plan again.</value><comment>long: why a sequence is not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Blocked.Offline" xml:space="preserve"><value>The archive is offline or read-only.</value><comment>long: why a sequence is not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Blocked.Unreadable" xml:space="preserve"><value>The sequence file cannot be read.</value><comment>long: why a sequence is not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Skipped.Missing" xml:space="preserve"><value>Missing photos stay as they are.</value><comment>long: why photos are not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Skipped.NoNativeDecoder" xml:space="preserve"><value>Photos of a format this computer cannot read at full resolution stay as they are.</value><comment>long: why photos are not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Skipped.PreviewOnly" xml:space="preserve"><value>Photos read only from their embedded preview here stay as they are.</value><comment>long: why photos are not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Skipped.SameFormat" xml:space="preserve"><value>Photos already in this format stay as they are.</value><comment>long: why photos are not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Skipped.Undecodable" xml:space="preserve"><value>Unreadable photos stay as they are.</value><comment>long: why photos are not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Skipped.Unhashed" xml:space="preserve"><value>Photos never verified stay as they are; verify the sequence first.</value><comment>long: why photos are not converted in a conversion dry run</comment></data>
<data name="Archive.Convert.Space" xml:space="preserve"><value>Needs {0}, free {1}</value><comment>long: free space line of a conversion dry run; {0} and {1} sizes</comment></data>
<data name="Archive.Convert.SpaceShort" xml:space="preserve"><value>Needs {0}, only {1} free: free some space first.</value><comment>long: free space line of a conversion dry run; {0} and {1} sizes</comment></data>
<data name="Archive.Convert.SpaceUnknown" xml:space="preserve"><value>Needs {0}; the free space cannot be measured.</value><comment>long: free space line of a conversion dry run; {0} size</comment></data>
<data name="Archive.Copy.Title" xml:space="preserve"><value>Folder to copy into the archive</value><comment>long</comment></data>
<data name="Archive.Delete.Action" xml:space="preserve"><value>Move to trash</value></data>
<data name="Archive.Delete.Blocked" xml:space="preserve"><value>Not moved: {0} · {1}</value><comment>long</comment></data>
@@ -80,6 +93,9 @@
<data name="Archive.Duplicates.Title" xml:space="preserve"><value>Duplicates</value></data>
<data name="Archive.Empty" xml:space="preserve"><value>No archive yet</value></data>
<data name="Archive.Error.Busy" xml:space="preserve"><value>Another Chronos ({0}) is writing here. Try again shortly.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.ConvertKept.one" xml:space="preserve"><value>{0:N0} sequence was not converted as planned; the job log says why.</value><comment>long: error sentence of a conversion job</comment></data>
<data name="Archive.Error.ConvertKept.other" xml:space="preserve"><value>{0:N0} sequences were not converted as planned; the job log says why.</value><comment>long: error sentence of a conversion job</comment></data>
<data name="Archive.Error.ConvertSpace" xml:space="preserve"><value>The conversion needs {0} free on the archive's volume, and {1} are free.</value><comment>long: error sentence of a conversion job; {0} and {1} sizes</comment></data>
<data name="Archive.Error.CopyMismatch" xml:space="preserve"><value>The copy of {0} does not match the original.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.DuplicateLost" xml:space="preserve"><value>{0} could not be added to the sequence.</value><comment>long: error sentence</comment></data>
<data name="Archive.Error.InLibrary" xml:space="preserve"><value>{0} is already in the library.</value><comment>long: error sentence</comment></data>
@@ -137,6 +153,13 @@
<data name="Archive.Log.AuditKept" xml:space="preserve"><value>Audit log kept in full</value><comment>long: job log line; a clean-up step whose age limit is 0</comment></data>
<data name="Archive.Log.AuditPurged" xml:space="preserve"><value>Audit entries removed: {0}</value><comment>long: job log line</comment></data>
<data name="Archive.Log.BackupDone" xml:space="preserve"><value>Index copied to {0} ({1}); copies kept: {2}</value><comment>long: job log line; {0} file path; {1} size, e.g. "12.4 MB"</comment></data>
<data name="Archive.Log.ConvertBlocked" xml:space="preserve"><value>Left as it was, busy or unreadable: {0}</value><comment>long: job log line; {0} sequence title</comment></data>
<data name="Archive.Log.ConvertChanged" xml:space="preserve"><value>Left as it was, changed after the plan: {0}</value><comment>long: job log line; {0} sequence title</comment></data>
<data name="Archive.Log.ConvertDone" xml:space="preserve"><value>Sequences converted: {0}, new sequences: {1}, photos: {2}</value><comment>long: job log line of a conversion</comment></data>
<data name="Archive.Log.ConvertFailed" xml:space="preserve"><value>Left as it was, a photo could not be converted: {0}: {1}</value><comment>long: job log line; {0} sequence title, {1} the reason</comment></data>
<data name="Archive.Log.ConvertNothing" xml:space="preserve"><value>Nothing to convert: {0}</value><comment>long: job log line; {0} sequence title</comment></data>
<data name="Archive.Log.Converted" xml:space="preserve"><value>{0}: photos replaced by their conversion: {1}</value><comment>long: job log line; {0} sequence title, {1} photos</comment></data>
<data name="Archive.Log.ConvertedNew" xml:space="preserve"><value>{0}: photos converted into a new sequence: {1}</value><comment>long: job log line; {0} sequence title, {1} photos</comment></data>
<data name="Archive.Log.DryRun" xml:space="preserve"><value>Dry run: nothing was changed.</value><comment>long: job log line</comment></data>
<data name="Archive.Log.DuplicateGroup" xml:space="preserve"><value>Extra copies of {0}: {1}</value><comment>long: job log line; {0} path of the first photo of a group sharing one hash</comment></data>
<data name="Archive.Log.DuplicatesDone" xml:space="preserve"><value>Duplicate groups: {0}, extra copies: {1}</value><comment>long: job log line</comment></data>
+1
View File
@@ -69,6 +69,7 @@
<data name="Jobs.Kind.Adopt" xml:space="preserve"><value>Adopt folder</value></data>
<data name="Jobs.Kind.Backup" xml:space="preserve"><value>Index backup</value></data>
<data name="Jobs.Kind.Cleanup" xml:space="preserve"><value>Clean-up</value></data>
<data name="Jobs.Kind.Convert" xml:space="preserve"><value>Convert</value></data>
<data name="Jobs.Kind.DeepAnalyse" xml:space="preserve"><value>Deep analysis</value></data>
<data name="Jobs.Kind.Download" xml:space="preserve"><value>Download</value></data>
<data name="Jobs.Kind.Duplicates" xml:space="preserve"><value>Duplicates</value></data>
+3
View File
@@ -23,6 +23,7 @@
<data name="Server.Conflict.TakeServer.Message" xml:space="preserve"><value>This PC's settings of {0} will be replaced by the server copy.</value><comment>long; {0} sequence title</comment></data>
<data name="Server.Conflict.TakeServer.Title" xml:space="preserve"><value>Take the server's settings?</value></data>
<data name="Server.Connect" xml:space="preserve"><value>Connect</value></data>
<data name="Server.Convert.OnPc" xml:space="preserve"><value>Convert these photos on a PC: the server cannot read them at full resolution.</value><comment>long: why photos are not converted in a conversion dry run on the server</comment></data>
<data name="Server.Disconnect" xml:space="preserve"><value>Disconnect</value></data>
<data name="Server.Empty" xml:space="preserve"><value>Not connected to a server</value></data>
<data name="Server.Error.AccountLocked" xml:space="preserve"><value>Too many failed sign-ins; the account is locked for a while.</value><comment>long</comment></data>
@@ -72,8 +73,10 @@
<data name="Server.Error.LastAdmin" xml:space="preserve"><value>The last administrator cannot be removed or disabled.</value><comment>long</comment></data>
<data name="Server.Error.MethodNotAllowed" xml:space="preserve"><value>This method is not allowed here.</value><comment>long</comment></data>
<data name="Server.Error.NestedTarget" xml:space="preserve"><value>A new folder would lie inside the folder of another sequence.</value><comment>long</comment></data>
<data name="Server.Error.NotEnoughSpace" xml:space="preserve"><value>The archive's volume lacks the space the conversion needs.</value><comment>long</comment></data>
<data name="Server.Error.NotFound" xml:space="preserve"><value>Not found.</value><comment>long</comment></data>
<data name="Server.Error.NotChronos" xml:space="preserve"><value>That address is not a Chronos Server.</value><comment>long</comment></data>
<data name="Server.Error.NothingToConvert" xml:space="preserve"><value>The plan converts nothing: every photo is skipped or every sequence is blocked.</value><comment>long</comment></data>
<data name="Server.Error.PasswordChangeRequired" xml:space="preserve"><value>Change your password first.</value><comment>long</comment></data>
<data name="Server.Error.PhotoRemoved" xml:space="preserve"><value>The photo was deleted from the sequence while it was being uploaded, so it was not added.</value><comment>long</comment></data>
<data name="Server.Error.PhotoUnreadable" xml:space="preserve"><value>{0} cannot be read, and without its hash other copies would not learn it was deleted; close the program using it or check its permissions, then try again.</value><comment>long</comment></data>
+1
View File
@@ -133,6 +133,7 @@
<data name="Admin.Job.Kind.Adopt" xml:space="preserve"><value>Adozione</value></data>
<data name="Admin.Job.Kind.Backup" xml:space="preserve"><value>Copia dell'indice</value></data>
<data name="Admin.Job.Kind.Cleanup" xml:space="preserve"><value>Pulizia</value></data>
<data name="Admin.Job.Kind.Convert" xml:space="preserve"><value>Conversione</value></data>
<data name="Admin.Job.Kind.DeepAnalyse" xml:space="preserve"><value>Analisi completa</value></data>
<data name="Admin.Job.Kind.Duplicates" xml:space="preserve"><value>Duplicati</value></data>
<data name="Admin.Job.Kind.EmptyTrash" xml:space="preserve"><value>Svuota cestino</value></data>
+23
View File
@@ -32,6 +32,19 @@
<data name="Archive.Confirm.Remove" xml:space="preserve"><value>Rimuovi riga</value></data>
<data name="Archive.Confirm.RemoveHeading" xml:space="preserve"><value>Rimuovere {0} dall'indice?</value></data>
<data name="Archive.Confirm.RemoveMessage" xml:space="preserve"><value>Il suo sidecar non c'è più. Viene rimossa solo la riga dell'indice; nessun file viene eliminato.</value></data>
<data name="Archive.Convert.Blocked.Busy" xml:space="preserve"><value>Un job sta lavorando su questa sequenza; convertila quando il job è finito.</value></data>
<data name="Archive.Convert.Blocked.FramesChanged" xml:space="preserve"><value>La sequenza è cambiata dopo il piano; rivedi il piano.</value></data>
<data name="Archive.Convert.Blocked.Offline" xml:space="preserve"><value>L'archivio non è raggiungibile o è di sola lettura.</value></data>
<data name="Archive.Convert.Blocked.Unreadable" xml:space="preserve"><value>Il file della sequenza non si può leggere.</value></data>
<data name="Archive.Convert.Skipped.Missing" xml:space="preserve"><value>Le foto mancanti restano come sono.</value></data>
<data name="Archive.Convert.Skipped.NoNativeDecoder" xml:space="preserve"><value>Le foto di un formato che questo computer non legge a piena risoluzione restano come sono.</value></data>
<data name="Archive.Convert.Skipped.PreviewOnly" xml:space="preserve"><value>Le foto lette qui solo dalla loro anteprima incorporata restano come sono.</value></data>
<data name="Archive.Convert.Skipped.SameFormat" xml:space="preserve"><value>Le foto già in questo formato restano come sono.</value></data>
<data name="Archive.Convert.Skipped.Undecodable" xml:space="preserve"><value>Le foto illeggibili restano come sono.</value></data>
<data name="Archive.Convert.Skipped.Unhashed" xml:space="preserve"><value>Le foto mai verificate restano come sono; verifica prima la sequenza.</value></data>
<data name="Archive.Convert.Space" xml:space="preserve"><value>Servono {0}, liberi {1}</value></data>
<data name="Archive.Convert.SpaceShort" xml:space="preserve"><value>Servono {0}, liberi solo {1}: libera prima dello spazio.</value></data>
<data name="Archive.Convert.SpaceUnknown" xml:space="preserve"><value>Servono {0}; lo spazio libero non si può misurare.</value></data>
<data name="Archive.Copy.Title" xml:space="preserve"><value>Cartella da copiare nell'archivio</value></data>
<data name="Archive.Delete.Action" xml:space="preserve"><value>Sposta nel cestino</value></data>
<data name="Archive.Delete.Blocked" xml:space="preserve"><value>Non spostata: {0} · {1}</value></data>
@@ -75,6 +88,9 @@
<data name="Archive.Duplicates.Title" xml:space="preserve"><value>Doppioni</value></data>
<data name="Archive.Empty" xml:space="preserve"><value>Nessun archivio</value></data>
<data name="Archive.Error.Busy" xml:space="preserve"><value>Un altro Chronos ({0}) sta scrivendo qui. Riprova tra poco.</value></data>
<data name="Archive.Error.ConvertKept.one" xml:space="preserve"><value>{0:N0} sequenza non è stata convertita come previsto; il log del job dice perché.</value></data>
<data name="Archive.Error.ConvertKept.other" xml:space="preserve"><value>{0:N0} sequenze non sono state convertite come previsto; il log del job dice perché.</value></data>
<data name="Archive.Error.ConvertSpace" xml:space="preserve"><value>La conversione richiede {0} liberi sul volume dell'archivio, e ne sono liberi {1}.</value></data>
<data name="Archive.Error.CopyMismatch" xml:space="preserve"><value>La copia di {0} non corrisponde all'originale.</value></data>
<data name="Archive.Error.DuplicateLost" xml:space="preserve"><value>Impossibile aggiungere {0} alla sequenza.</value></data>
<data name="Archive.Error.InLibrary" xml:space="preserve"><value>{0} è già nella libreria.</value></data>
@@ -132,6 +148,13 @@
<data name="Archive.Log.AuditKept" xml:space="preserve"><value>Registro di controllo conservato per intero</value></data>
<data name="Archive.Log.AuditPurged" xml:space="preserve"><value>Voci di controllo rimosse: {0}</value></data>
<data name="Archive.Log.BackupDone" xml:space="preserve"><value>Indice copiato in {0} ({1}); copie conservate: {2}</value></data>
<data name="Archive.Log.ConvertBlocked" xml:space="preserve"><value>Lasciata com'era, occupata o illeggibile: {0}</value></data>
<data name="Archive.Log.ConvertChanged" xml:space="preserve"><value>Lasciata com'era, cambiata dopo il piano: {0}</value></data>
<data name="Archive.Log.ConvertDone" xml:space="preserve"><value>Sequenze convertite: {0}, nuove sequenze: {1}, foto: {2}</value></data>
<data name="Archive.Log.ConvertFailed" xml:space="preserve"><value>Lasciata com'era, una foto non si è potuta convertire: {0}: {1}</value></data>
<data name="Archive.Log.ConvertNothing" xml:space="preserve"><value>Niente da convertire: {0}</value></data>
<data name="Archive.Log.Converted" xml:space="preserve"><value>{0}: foto sostituite dalla loro conversione: {1}</value></data>
<data name="Archive.Log.ConvertedNew" xml:space="preserve"><value>{0}: foto convertite in una nuova sequenza: {1}</value></data>
<data name="Archive.Log.DryRun" xml:space="preserve"><value>Simulazione: nulla è stato modificato.</value></data>
<data name="Archive.Log.DuplicateGroup" xml:space="preserve"><value>Copie in più di {0}: {1}</value></data>
<data name="Archive.Log.DuplicatesDone" xml:space="preserve"><value>Gruppi di duplicati: {0}, copie in più: {1}</value></data>
+1
View File
@@ -69,6 +69,7 @@
<data name="Jobs.Kind.Adopt" xml:space="preserve"><value>Adozione cartella</value></data>
<data name="Jobs.Kind.Backup" xml:space="preserve"><value>Copia dell'indice</value></data>
<data name="Jobs.Kind.Cleanup" xml:space="preserve"><value>Pulizia</value></data>
<data name="Jobs.Kind.Convert" xml:space="preserve"><value>Conversione</value></data>
<data name="Jobs.Kind.DeepAnalyse" xml:space="preserve"><value>Analisi approfondita</value></data>
<data name="Jobs.Kind.Download" xml:space="preserve"><value>Scaricamento</value></data>
<data name="Jobs.Kind.Duplicates" xml:space="preserve"><value>Duplicati</value></data>
+3
View File
@@ -21,6 +21,7 @@
<data name="Server.Conflict.TakeServer.Message" xml:space="preserve"><value>Le impostazioni di {0} su questo PC saranno sostituite dalla copia del server.</value></data>
<data name="Server.Conflict.TakeServer.Title" xml:space="preserve"><value>Usare le impostazioni del server?</value></data>
<data name="Server.Connect" xml:space="preserve"><value>Connetti</value></data>
<data name="Server.Convert.OnPc" xml:space="preserve"><value>Converti queste foto su un PC: il server non le legge a piena risoluzione.</value></data>
<data name="Server.Disconnect" xml:space="preserve"><value>Disconnetti</value></data>
<data name="Server.Empty" xml:space="preserve"><value>Non connesso a un server</value></data>
<data name="Server.Error.AccountLocked" xml:space="preserve"><value>Troppi accessi falliti; l'account è bloccato per un po'.</value></data>
@@ -70,8 +71,10 @@
<data name="Server.Error.LastAdmin" xml:space="preserve"><value>L'ultimo amministratore non può essere rimosso o disattivato.</value></data>
<data name="Server.Error.MethodNotAllowed" xml:space="preserve"><value>Metodo non consentito qui.</value></data>
<data name="Server.Error.NestedTarget" xml:space="preserve"><value>Una nuova cartella finirebbe dentro la cartella di un'altra sequenza.</value></data>
<data name="Server.Error.NotEnoughSpace" xml:space="preserve"><value>Il volume dell'archivio non ha lo spazio che serve alla conversione.</value></data>
<data name="Server.Error.NotFound" xml:space="preserve"><value>Non trovato.</value></data>
<data name="Server.Error.NotChronos" xml:space="preserve"><value>Questo indirizzo non è un Chronos Server.</value></data>
<data name="Server.Error.NothingToConvert" xml:space="preserve"><value>Il piano non converte nulla: ogni foto è esclusa o ogni sequenza è bloccata.</value></data>
<data name="Server.Error.PasswordChangeRequired" xml:space="preserve"><value>Cambia prima la password.</value></data>
<data name="Server.Error.PhotoRemoved" xml:space="preserve"><value>La foto è stata eliminata dalla sequenza mentre veniva caricata, quindi non è stata aggiunta.</value><comment>long</comment></data>
<data name="Server.Error.PhotoUnreadable" xml:space="preserve"><value>Impossibile leggere {0}: senza il suo hash le altre copie non saprebbero che è stato eliminato. Chiudi il programma che lo usa o controlla i permessi, poi riprova.</value></data>