Skip to content

Auto-orient images and preserve encoder options#397

Merged
JimBobSquarePants merged 1 commit intomainfrom
js/default-auto-orient
Apr 6, 2026
Merged

Auto-orient images and preserve encoder options#397
JimBobSquarePants merged 1 commit intomainfrom
js/default-auto-orient

Conversation

@JimBobSquarePants
Copy link
Copy Markdown
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 matches 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

Fix #304
Fix #375
Fix #381

This pull request enhances the handling and demonstration of image metadata and orientation in the ImageSharp.Web sample project, and improves default middleware behavior for web image processing. The main focus is on ensuring correct display of images with ICC profiles and EXIF orientation, especially for WEBP images. It also introduces automatic EXIF orientation correction for WEBP images and expands sample coverage.

Sample and Documentation Improvements:

  • Added a new section in Index.cshtml demonstrating EXIF auto-orientation for WEBP images, including a new sample image Exif5-1x.webp to visually verify correct orientation handling. [1] [2]
  • Updated the ICC Profiles section in Index.cshtml to clarify that ICC profiles are converted to sRGB by default, and adjusted sample image widths for improved display.

Middleware and Processing Enhancements:

  • Modified ImageSharpMiddlewareOptions so that the auto-orient command is automatically injected for images if not already present, ensuring correct orientation in browsers that ignore WEBP EXIF orientation.
  • Updated QualityWebProcessor to copy additional encoding options (Progressive, ProgressiveScans, RestartInterval) from the reference image, allowing for more accurate and flexible image encoding.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86%. Comparing base (338c719) to head (790a2b1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #397   +/-   ##
===================================
  Coverage    86%    86%           
===================================
  Files        83     83           
  Lines      2438   2453   +15     
  Branches    365    366    +1     
===================================
+ Hits       2103   2119   +16     
+ Misses      224    223    -1     
  Partials    111    111           
Flag Coverage Δ
unittests 86% <100%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JimBobSquarePants JimBobSquarePants merged commit fefde84 into main Apr 6, 2026
10 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/default-auto-orient branch April 6, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant