feat(ocr): multi-pass OCR and audit-log serialization fix#26
Open
ndomako10 wants to merge 1 commit into
Open
Conversation
Replace single-pass configurable-scale OCR with four automatic passes (100%, 75%, 50%, 25%) returning on the first pass that yields a 4-digit group (ok) or keeping the best low-confidence result as fallback. Removes the ScalePct / OcrScalePercent parameter. Guard audit-log writes against PS5.1 ConvertTo-Json unwrapping a single-element array as a bare object; wraps the 1-entry case explicitly so the log is always valid JSON. Also tightens the Where-Object dedup filter to skip entries lacking OriginalFile (previously caused errors on malformed log entries) and restores the IMG_*.jpg + IMG_*.jpeg file filter. closes #25
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.
Summary
ScalePct/OcrScalePercentparameter.ConvertTo-Json -InputObjecton a single-element array serializes the bare object instead of a JSON array, corruptingrename-log.jsonon any run that processes exactly one new photo.Where-Objectto skip entries that lackOriginalFile(previously threw on malformed entries), and restores theIMG_*.jpg+IMG_*.jpegfile filter.Closes #25
Test plan
.\scripts\Rename-Photos.ps1 -WhatIfagainst a folder with a single photo — verify no output file changesrename-log.jsonis written as a JSON array[{…}], not a bare object{…}ok-confidence readings on normal odometer photos