fix(project): accept legacy version 3 project files - #178
Draft
doogie99 wants to merge 1 commit into
Draft
Conversation
Projects from 4lex4-era forks and v1.1.x store format version 3; the readers already handle their content via attribute fallbacks, but the strict equality check against PROJECT_VERSION rejected them. Accept versions 3 through PROJECT_VERSION. Co-Authored-By: Claude Fable 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.
Problem
v1.2.0 bumped
PROJECT_VERSIONfrom 3 to 4, and bothProjectReaderandProjectOpeningContextcheck the file's version with strict equality. Every project created with 4lex4-era builds or with this project's own releases up to v1.1.x (all of which wrote version 3) is rejected with "The project file is not compatible with the current application version" — even though the v4 readers handle v3 content fine via attribute fallbacks (e.g.obliqueModeFromXml's fallback chain for the deskew params added in v1.2.0).This hits exactly the users the community fork most wants to migrate: people coming from the abandoned upstream with existing projects.
Fix
Accept versions 3 through
PROJECT_VERSIONin both check sites. Versions below 3 (original ScanTailor lineage) remain rejected, as the readers were never written for them. Files are upgraded to version 4 on the next save, sinceProjectWriteralways writes the current version.Testing
Opened a real-world 46-image/90-page project written by a 4lex4-era build (version 3): loads with all page splits, deskew angles, content boxes, and output settings intact; saving rewrites it as version 4. Built and tested on macOS 26 (arm64, Qt 6.11).
🤖 Generated with Claude Code