Git Product home page Git Product logo

Comments (2)

lovell avatar lovell commented on August 28, 2024

Thanks for the detailed proposal. My understanding of this is that there are 2 main topics being discussed here, both of which are a good idea.

  1. Fix the bug to allow the use of a flip and/or flip operation when also using parameter-less rotate() for images containing EXIF Orientations 2, 4, 5 or 7.
  2. Add syntactic sugar for the parameter-less rotate(), either a constructor property as you suggest or perhaps autoOrient() (e.g. #711). This would involve improving the docs to make it clear that both auto-orientation and rotate(angle) can be used in the same pipeline and will deprecate use of the parameter-less rotate().

(Providing a runtime environment variable to control this feels like pain for me rather than benefit for thee, so no interest in that, sorry.)

from sharp.

happycollision avatar happycollision commented on August 28, 2024

Sounds like a winning compromise! I completely understand that taking on new features is very tricky since now you have to support them. I think adding the syntactic sugar for .rotate() will actually solve the problem in most cases for downstream wrappers, because now they would need to support an additional command with a different name, thus preventing them from missing the nuance inherent to .rotate's various invocations.

And I could be wrong (because I got in and out of several patches of weeds) but I think that sharp(img).rotate().rotate(90) does not currently work the way one might think about it. The 90 degree rotation is not applied in addition to the orientation, but rather instead of it. Double check me, but I am pretty sure that is the case. I'll adjust my branch to change the API to match what you'd prefer. At the very least, I'll rebase against some tests that fail on the cases we'd be trying to adjust for.

from sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.