Skip to content

Conversation

iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Oct 7, 2025

No description provided.

@iequidoo iequidoo force-pushed the iequidoo/exif-continue_on_error branch from 15ed531 to 966cd48 Compare October 7, 2025 05:35
let exif = exif::Reader::new()
.continue_on_error(true)
.read_from_container(&mut bufreader)
.or_else(|e| e.distill_partial_result(|_errors| {}))
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to log something in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We only use the orientation field from Exif, so errors here are probably irrelevant, but we can log them if we pass Context to this function, i'm just unsure it's worth doing that

Copy link
Contributor

Choose a reason for hiding this comment

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

what is the change in this file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a comment to test_recode_image_1(), i corrupted Exif in this file to test that it's still detected and removed by recoding the file. I could add another file instead, but we already have several JPEG test files, others contain Exif without invalid fields, so parsing correct Exif is still covered by other tests

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd at least rename this file to have "corrupted_exif" or so on the name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And I think it's better to add a new test for this without modifying existing one with no broken exif.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Finally decided to add another test using another file not to affect existing tests

@iequidoo iequidoo requested a review from Simon-Laux October 10, 2025 03:34
@iequidoo iequidoo force-pushed the iequidoo/exif-continue_on_error branch from 966cd48 to 67360bd Compare October 10, 2025 03:42
NB: This still doesn't help with detecting Exif in PNGs unfortunately.
@iequidoo iequidoo force-pushed the iequidoo/exif-continue_on_error branch from 67360bd to a5829cd Compare October 12, 2025 07:41
@iequidoo iequidoo requested a review from link2xt October 12, 2025 07:44
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.

3 participants