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

Handle EXIF orientation flag #4021

Merged
merged 2 commits into from
Jul 22, 2022
Merged

Handle EXIF orientation flag #4021

merged 2 commits into from
Jul 22, 2022

Conversation

delucis
Copy link
Member

@delucis delucis commented Jul 22, 2022

Changes

Update the metadata retrieval method used by the image integration to take the EXIF orientation flag into account.

An example of this technique is shown in the Sharp docs (3rd example): https://sharp.pixelplumbing.com/api-input#examples

The image-size module being used here similarly returns orientation if found.

Testing

Not tested yet — would need an image with the flag to do that.

Docs

No docs needed as this is effectively a bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Jul 22, 2022

🦋 Changeset detected

Latest commit: dd26b26

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/image Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@delucis delucis requested a review from tony-sull July 22, 2022 15:17
@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jul 22, 2022
@natemoo-re
Copy link
Member

Nice! I found https://github.com/recurser/exif-orientation-examples if these are at all helpful for tests

Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

I'll have a larger image PR out today so I'll merge add a couple tests for this while I'm at it

@tony-sull tony-sull merged commit 9aecf7c into main Jul 22, 2022
@tony-sull tony-sull deleted the delucis/image-orientation branch July 22, 2022 19:14
@astrobot-houston astrobot-houston mentioned this pull request Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants