Skip to content

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Reimplement of #2869 for v3.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the nested sub-IFDs parsing fix for JPEG metadata by introducing new tests to verify correct parsing and updating the underlying EXIF reader logic.

  • Added a new test case for issue 2857 in the JPEG test suite.
  • Updated ExifReader logic to process nested sub-IFDs with batch limits and improved duplicate checking.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
tests/ImageSharp.Tests/TestImages.cs Added constant for test image issue 2857.
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Metadata.cs Introduced new test method for validating sub-IFDs parsing along with various EXIF metadata assertions.
src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs Modified sub-ifd reading loop with batch processing and adjusted duplicate comparison logic.
Files not reviewed (1)
  • tests/Images/Input/Jpg/issues/issue-2857-subsub-ifds.jpg: Language not supported
Comments suppressed due to low confidence (1)

src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs:198

  • [nitpick] Consider renaming variable 'sz' to 'batchSize' for improved clarity.
int sz = Math.Min(this.subIfds.Count, maxSubIfds);

@JimBobSquarePants JimBobSquarePants merged commit 9593e08 into release/3.1.x Apr 24, 2025
22 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/backport-2869 branch April 24, 2025 12:52
This was referenced Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant