Skip to content

Skip invalid recipe images - #69

Merged
gosku merged 6 commits into
mainfrom
skip-invalid-recipe-images
Aug 6, 2026
Merged

Skip invalid recipe images#69
gosku merged 6 commits into
mainfrom
skip-invalid-recipe-images

Conversation

@gosku

@gosku gosku commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What

Images whose EXIF cannot produce a valid recipe are now recorded as a skip on every ingest path, instead of raising InvalidFujifilmRecipeData uncaught.

The known trigger: when the camera drives saturation rather than the user, the Fujifilm Color tag holds the literal string Film Simulation. color_from_exif() maps that to None, and a colour simulation with no Color fails validate_recipe_data().

Why

The exception escaped process_image and nothing on any ingest path caught it:

path before after
_process_images_in_folder (lite/SQLite) aborted the whole folder run file skipped, run continues
process_image_task (Celery, default) task marked FAILURE returns a skip result
process_synced_image (library sync) counted as an error, with a traceback counted as skipped
import_recipes_from_uploaded_files 500 from the upload view reported in failed

Notes

  • Validation failure is the signal. validate_recipe_data() already defines what "cannot produce a recipe" means, so there is no new sentinel detection, no new exception type, and no domain behaviour change. Only the orchestration layer was missing a handler.
  • No bare except Exception was added, so a genuine bug still surfaces loudly.
  • Skips publish image.import.skipped carrying the reason and offending field. This also retro-fits observability onto the no-film-simulation skips, which were silent before.
  • import_images_from_folder now returns FolderImportSummary rather than int, so the command can report skipped counts. One caller.

gosku and others added 6 commits August 5, 2026 22:14
An image whose EXIF cannot produce a valid recipe raised
InvalidFujifilmRecipeData out of process_image, which nothing on the
sequential ingest path caught. A single such file aborted the whole
folder run in the lite/SQLite install.

Record those files as skipped alongside the ones carrying no Fujifilm
metadata, and return a FolderImportSummary so the management command can
report processed and skipped counts instead of only the total found.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Skipped images were silent: neither the Celery task nor the sequential
loop recorded why a file produced no recipe, so a skip was only visible
as a missing row.

Publish image.import.skipped with the reason, and the offending recipe
field when the EXIF failed validation. On the async path this is the only
place a skip surfaces, since the management command returns before any
worker has run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A file whose EXIF cannot produce a valid recipe fell through to the
catch-all branch, so a sync run reported it as an error and logged a
traceback for an outcome that is expected and harmless.

Count it as skipped instead, next to the files carrying no Fujifilm
metadata, leaving the error counter for genuine failures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
An uploaded JPG whose EXIF cannot produce a valid recipe raised
InvalidFujifilmRecipeData past the use case and into the import view,
returning a 500 instead of telling the user which file was rejected.

Record it in ImportRecipesResult.failed alongside the non-Fujifilm files,
so the whole upload is reported rather than aborted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The ingest entry points could raise InvalidFujifilmRecipeData without
saying so, which is how the exception went unhandled on every path.

Record it in the docstrings and cover it directly, including that the
surrounding transaction leaves no FujifilmExif row behind when a recipe
is rejected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Color section claimed the recipe stores "N/A" for a non-numeric
value, which is what Sharpness does; Color returns None. It also framed
the sentinel as a property of certain film simulations, when the same
simulations carry numeric values on almost every shot.

Describe what the value actually means, and document how the resulting
skips are reported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gosku
gosku merged commit 0a315cc into main Aug 6, 2026
4 checks passed
@gosku
gosku deleted the skip-invalid-recipe-images branch August 6, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant