-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Respect EXIF orientation when resizing #217
Conversation
Codecov Report
@@ Coverage Diff @@
## master #217 +/- ##
=====================================
- Coverage 87% 87% -1%
=====================================
Files 70 70
Lines 1811 1826 +15
Branches 266 269 +3
=====================================
+ Hits 1577 1589 +12
- Misses 165 167 +2
- Partials 69 70 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Question. Do we even need #215 anymore? I'm thinking we actually don't. It's probably best we don't provide a destructive operation - People can implement their own should they need to. |
Totally agree and to make it more reusable, the logic should probably also be in a separate helper class. Maybe it should even be a part of ImageSharp itself, so you can easily get the auto-oriented size (and/or crop coordinates) when doing manual transforms? I see you've already started on related changes in SixLabors/ImageSharp#1976, so maybe add an For ImageSharp.Web the logic could then be moved to
This processor still has a different responsibility: auto-orienting the image for browsers/viewers that don't support auto-rotating based on the EXIF value or when you need to disable this functionality (using |
@ronaldbarendse I don't think moving the current logic into some sort of public helper is worth the maintenance effort to try and design something genuinely useful. If you want to make your web processors do similar ImageSharp exposes all you need to allow that. (Note also that I've no plans to add such helpers to ImageSharp. This work is an abstraction which operates in the opposite way to the correct methods in ImageSharp. |
Shouldn't the Might be easier to mutate the |
@ronaldbarendse Good catch, I'll open a PR today. EDIT. |
Prerequisites
Description
In addition to #215 we need the ability to resize images containing EXIF orientation metadata that specifies rotation based upon the users observed expectation without updating the EXIF metadata.
This PR updates the
ResizeWebProcessor
to swap dimensions parsed from command when a value indicating EXIF rotation is detected. This behavior can be turned off per request by passing the commandorient=false
(Note I've deliberately not used anr
prefix to make this more reusable for other potential transforming processors).cc\ @ronaldbarendse