vercel / og-image

Open Graph Image as a Service - generate cards for Twitter, Facebook, Slack, etc
https://og-image.vercel.app
MIT License
4.05k stars 1.27k forks source link

fix: If a period is included, subsequent characters are not interpreted. #213

Closed mrskiro closed 2 years ago

mrskiro commented 2 years ago

Hi! Thank you very much for providing us with a great library.

Fixed a problem in which if a parsed string contained a period, the characters after the period were omitted.

Before Next.js → Next

After Next.js → Next.js

vercel[bot] commented 2 years ago

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

Name Status Preview Updated
og-image ✅ Ready (Inspect) Visit Preview Jul 11, 2022 at 4:53PM (UTC)
mrskiro commented 2 years ago

@styfle sure. thank you so much.😄 before https://og-image.vercel.app/Next.js after https://og-image-eta-sable.vercel.app/Next.js

styfle commented 2 years ago

@purp1eeeee Thats expected behavior. You need to include the file extension to set the image format. For example:

https://og-image.vercel.app/Next.js.png

https://og-image.vercel.app/Next.js.jpeg

mrskiro commented 2 years ago

@styfle

Oh, sure, adding the extension solved the problem.

But I don't think you necessarily have to add the extension. In that case, this PR will help.

example https://og-image.vercel.app/I%20created%20a%20blog%20with%20Next.js%20and%20vercel want: I created a blog with Next.js and vercel expect: I created a blog with Next

styfle commented 2 years ago

This change breaks the default behavior as seen here: https://og-image-git-fork-purp1eeeee-fix-parse-period.vercel.sh/

I wouldn't expect png to show up

image
mrskiro commented 2 years ago

Indeed, "png" is displayed. To solve this problem, I needed to specify .png at the time of the request. I did that and the problem was solved. Thank you very much.