Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Photometadata class more robust #781

Merged
merged 18 commits into from
Dec 2, 2024

Conversation

jeremypw
Copy link
Collaborator

May fix some issues with loading corrupt metadata.

  • Replaces an assert statement with throwing errors
  • Replaces deprecated GExiv2 methods with new error throwing ones and handle errors where necessary

@jeremypw
Copy link
Collaborator Author

The probable cause for reported crashes has now been found and fixed (see #785 ) so the changes here are mainly cosmetic - there is no evidence at the moment that they give rise to crashes. As there are no test defined in the codebase any regressions will have to be found by user testing I guess 😞 The codebase is littered with myriad functions that return null but in practice seems fairly stable so whether it is worth the work of updating it is debatable.

@jeremypw
Copy link
Collaborator Author

If desired I can separate smaller PRs for individual fixes that seem more worthwhile than others.

Copy link
Contributor

@zeebok zeebok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code seems good to me. Don't have a file to test with but shrug

@jeremypw
Copy link
Collaborator Author

jeremypw commented Dec 2, 2024

I don't think any change here will alter behaviour - just create more error messages so there shouldn't be any regressions. I have tested it on my own collection without problems. I found a set of test images for PNG format at https://github.com/YahooArchive/pngjs-image/tree/master/test/png/PngSuite and these were imported without crashing (some .raw images were rejected).

@zeebok
Copy link
Contributor

zeebok commented Dec 2, 2024

Yeah, I have a whole butt load of images from taking photos and the it doesn't crash but it wasn't crashing before either so I can't test if it crashes less :P

@zeebok zeebok merged commit 63ae89b into master Dec 2, 2024
3 checks passed
@zeebok zeebok deleted the jeremypw/more-robust-photometadata branch December 2, 2024 17:11
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.

2 participants