Skip to content

Conversation

@rgdcastro
Copy link
Contributor

Addresses an issue where large metadata segments in JPEGs could cause parsing to fail.

The changes now allow skipping segments that exceed the buffer size, enabling the parser to continue searching for the start of frame (SOF) marker and extract image dimensions.

When a URL is available as the image source, it retries parsing with progressively larger buffers when initial parsing fails, accommodating images with large metadata blocks. This ensures that dimensions can be extracted even for complex JPEG images.

Addresses an issue where large metadata segments in JPEGs could cause parsing to fail.

The changes now allow skipping segments that exceed the buffer size, enabling the parser to continue searching for the start of frame (SOF) marker and extract image dimensions.

When a URL is available as the image source, it retries parsing with progressively larger buffers when initial parsing fails, accommodating images with large metadata blocks. This ensures that dimensions can be extracted even for complex JPEG images.
@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation tests cli dependencies configuration labels Oct 10, 2025
@rgdcastro rgdcastro changed the title Improves JPEG parsing robustness fix: Improves JPEG parsing robustness Oct 10, 2025
@rgdcastro rgdcastro changed the title fix: Improves JPEG parsing robustness fix: improves JPEG parsing robustness Oct 10, 2025
@rgdcastro rgdcastro merged commit 4cae382 into main Oct 10, 2025
38 of 42 checks passed
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 23.07692% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/index.ts 16.66% 25 Missing ⚠️
src/parsers/jpeg.ts 44.44% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli configuration dependencies documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants