Skip invalid recipe images - #69
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Images whose EXIF cannot produce a valid recipe are now recorded as a skip on every ingest path, instead of raising
InvalidFujifilmRecipeDatauncaught.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 toNone, and a colour simulation with no Color failsvalidate_recipe_data().Why
The exception escaped
process_imageand nothing on any ingest path caught it:_process_images_in_folder(lite/SQLite)process_image_task(Celery, default)process_synced_image(library sync)import_recipes_from_uploaded_filesfailedNotes
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.except Exceptionwas added, so a genuine bug still surfaces loudly.image.import.skippedcarrying the reason and offending field. This also retro-fits observability onto the no-film-simulation skips, which were silent before.import_images_from_foldernow returnsFolderImportSummaryrather thanint, so the command can report skipped counts. One caller.