Skip to content

Handle EXIF orientation flag#4021

Merged
tony-sull merged 2 commits into
mainfrom
delucis/image-orientation
Jul 22, 2022
Merged

Handle EXIF orientation flag#4021
tony-sull merged 2 commits into
mainfrom
delucis/image-orientation

Conversation

@delucis

@delucis delucis commented Jul 22, 2022

Copy link
Copy Markdown
Member

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

changeset-bot Bot commented Jul 22, 2022

Copy link
Copy Markdown

🦋 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
Copy Markdown
Member

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

@tony-sull tony-sull left a comment

Copy link
Copy Markdown
Contributor

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