image icon indicating copy to clipboard operation
image copied to clipboard

feat: encode reserved characters in URI path

Open riddla opened this issue 1 year ago • 4 comments

I fell into a rabbit hole yesterday analysing why Slack would not show the preview of an og:image. After a long try and error I discovered that the URIs generated via the ipx provider contains ampersands respectively: the Slackbot needs URIs with encoded reserved characters in the URIs path .

With encoded characters (fit_inside%26f_png%26s_1200x630) the preview came to life.

riddla avatar Mar 01 '24 10:03 riddla

I'm opening a new PR as I don't have permission to push to this one: https://github.com/nuxt/image/pull/2005

danielroe avatar Nov 03 '25 15:11 danielroe

@riddla feel free to pull in my commits in the linked branch on nuxt/image into this PR.

testing it out in the playground, it doesn't seem to work. I get this error:

[500] [IPX_ERROR] Expected number between 0.3 and 1000 for sigma but received undefined of type undefined

danielroe avatar Nov 03 '25 15:11 danielroe

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@1268

commit: 35b70c9

pkg-pr-new[bot] avatar Nov 04 '25 06:11 pkg-pr-new[bot]

@danielroe, the change in #08fcb23 sorts the parameters in alphabetical order.

Which did fix the ipx image not showing up in the playground. But to be honest, I did not fully grasp the underlying issue in ipx, so this pragmatic approach might not be sufficient.

riddla avatar Nov 05 '25 07:11 riddla