Skip to content
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

[PATCH-PACKAGE] Prevent images from being rotated if the original contains EXIF orientation metadata #135

Closed
jdvivar opened this issue Jan 2, 2022 · 4 comments
Labels
duplicate This issue or pull request already exists
Milestone

Comments

@jdvivar
Copy link

jdvivar commented Jan 2, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @11ty/eleventy-img@1.0.0 for the project I'm working on.

#93

Here is the diff that solved my problem:

diff --git a/node_modules/@11ty/eleventy-img/img.js b/node_modules/@11ty/eleventy-img/img.js
index 97ec5f5..9e6eee8 100644
--- a/node_modules/@11ty/eleventy-img/img.js
+++ b/node_modules/@11ty/eleventy-img/img.js
@@ -434,7 +434,7 @@ class Image {
           if(metadata.format !== "svg" || !this.options.svgAllowUpscale) {
             resizeOptions.withoutEnlargement = true;
           }
-          sharpInstance.resize(resizeOptions);
+          sharpInstance.rotate().resize(resizeOptions);
         }
 
         if(!this.options.dryRun) {

This issue body was partially generated by patch-package.

@jdvivar jdvivar changed the title Rotated images [PATCH-PACKAGE] Prevent images from being rotated if the original contains EXIF orientation metadata Jan 2, 2022
@chrissy-dev
Copy link

I need this 🥇 💯

@zachleat
Copy link
Member

The merge from #132 fixes this and will ship with 1.1.0

@zachleat zachleat added this to the v1.1.0 milestone Feb 23, 2022
@zachleat zachleat added the duplicate This issue or pull request already exists label Feb 23, 2022
@jdvivar
Copy link
Author

jdvivar commented Feb 23, 2022

Great, thanks @zachleat

@chrissy-dev
Copy link

Nice one @zachleat 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants