Skip to content

fix(image-render): match image embeds based on file extension in url #29

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

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

stephancill
Copy link
Contributor

@stephancill stephancill commented Oct 23, 2023

Updated image-render miniapp content entry points to be matched when the embed URL ends with common image extensions i.e. .png, .jpg, .jpeg, .gif, .svg, and .webp

@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2023

🦋 Changeset detected

Latest commit: f212721

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

This PR includes changesets to release 1 package
Name Type
@miniapps/image-render 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

@vercel
Copy link

vercel bot commented Oct 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2023 7:45am
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2023 7:45am
example-nextjs-shadcn ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2023 7:45am

{ equals: "{{embed.metadata.image.url}}" },
{ endsWith: ".png" },
{ endsWith: ".jpg" },
{ endsWith: ".jpeg" },
Copy link
Contributor

Choose a reason for hiding this comment

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

What about .webp?

How are we handling when theres no file extension but the content type has an image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add .webp

If there is no file extension and the open-graph API recognizes that the endpoint has an image it will be matched by embed.metadata.image.url. #16 also adds a mimeType attribute to the UrlMetadata type so we can match that too when it's merged.

Copy link
Contributor

@davidfurlong davidfurlong Oct 23, 2023

Choose a reason for hiding this comment

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

ok - how do you want to go about the two PRs interdependence? happy with whatever

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fine to merge this now and open a new PR with the mimeType change when it's available. This should handle the vast majority of cases fine in the meantime

@davidfurlong davidfurlong merged commit 6e38b0c into main Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants