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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add experimental image orientation fix #724

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on May 29, 2024

  1. Add options object to applyTransforms

    The options object will allow more configuration without blowing up the
    arity of the function.
    
    Backwards compatible, though I suggest deprecating the old style if you
    keep this change.
    happycollision committed May 29, 2024
    Configuration menu
    Copy the full SHA
    e948905 View commit details
    Browse the repository at this point in the history
  2. Add tests to exercise current orientation behavior

    To stay backwards compatible and ensure that current users are not
    affected by upcoming changes, we need to test the current behavior of
    the `flip`, `flop`, and `rotate` transforms when applied to images with
    EXIF orientation metadata.
    
    The images added to __fixtures__ are all rotated via EXIF orientation.
    Whether or not they appear correctly in your image viewer is dependent
    on its ability to read that orientation metadata. The resulting PNG
    files show the problems that people run into when they don't account for
    orientation metadata in their image processing. The next commit will
    introduce a new setting that attempts to give developers the results
    they actually expect.
    happycollision committed May 29, 2024
    Configuration menu
    Copy the full SHA
    90fbf05 View commit details
    Browse the repository at this point in the history
  3. Add experimental setting: preserveInitialOrientation

    This experimental setting is intended to give developers an easy way to
    treat their images intuitively based on how they actually look on
    screen, instead of how they are actually written on disk.
    
    There is an overhead to certain orientations that might be too high a
    cost to pay, but that is why this is experimental. Working on this
    feature has made me believe that the best place to add the DX
    improvement is actually within Sharp itself. In the meantime there is
    something here worth trying out.
    happycollision committed May 29, 2024
    Configuration menu
    Copy the full SHA
    5a7978a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c939952 View commit details
    Browse the repository at this point in the history