Comments (4)
You could call .AutoOrient
on the image before you resize it. This will rotate the image to the "correct" orientation.
from imagesharp.
@dj-nitehawk I can confirm, based on your test image, that .AutoOrient()
is all you need to do to fix your issue.
from imagesharp.
@dlemstra @tocsoft Thanks.. That answer does the trick but...
@dj-nitehawk It's best to also explain why ImageSharp is actually doing the right thing without AutoRotate
ImageSharp is actually correctly resizing those images.
Jpeg files have specific values in something called the Start of Frame marker which defines the width and height of the image. ImageSharp, like any other library (e.g System.Drawing) will read those values to determine the correct dimensions and layout of the byte array to store that image data.
The EXIF metadata contained within the image is additional, unrelated data that is sometimes used to determine how the image is displayed (i.e. rotation).
This data does not determine how the width and height of an image is calculated. Software like Photoshop might (I haven't tested) present the image in a rotated fashion with the dimensions swapped to make it less confusing for the end user but a graphics library will not.
I hope that makes sense
from imagesharp.
thanks guys!
.AutoOrient()
does the job perfectly...
appreciate the super-fast support :-)
from imagesharp.
Related Issues (20)
- Image.Load Error HOT 1
- ImageSharp is not supporting negative values on writing EXIF MetaData HOT 1
- Saving webp to jpg gives strange result HOT 5
- sixlabors.imagesharp is missing NuGet package README file
- Unable to generate a thumbnail as expected HOT 10
- CR2: System.NotSupportedException: Missing SOI marker offset for tiff with old jpeg compression HOT 2
- NullReferenceException when trying to load an animated PNG HOT 1
- Black Background after resizing in the latest version. HOT 4
- AccessViolationException and hard crash with animated webp HOT 8
- Simple conversion of Tiff file to PNG or JPG generates a strange result, even, at certain times, it is in 3D perspective HOT 6
- Please backport CVE-2024-27929 to 2.1.x HOT 20
- no vulnerability free version for netstandard or netframework 4.7 HOT 1
- Cannot update to v2.1.7 due to vulnerability tag HOT 4
- Exception SixLabors.ImageSharp.ImageFormatException: 'reserved bytes should be zero' when using Image.LoadAsync HOT 7
- Exif rotation and save HOT 4
- Error SixLabors.ImageSharp.ImageFormatException: 'Unexpected chunk followed VP8X header' HOT 3
- File (detected as bmp) fails to open, consumes a lot of memory HOT 4
- regression on latest.. 3 vs 2 with GIF HOT 6
- APNG Decoder incorrectly handles frame offsets and dispose previous with blend over HOT 3
- Hard crash (Internal CLR error) with corrupt PNG image HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagesharp.