Skip to content

[providers/storyblok] Storyblok focal point filter trips up splitfilters() #170

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

Open
grgcnnr opened this issue Apr 2, 2025 · 2 comments · May be fixed by #171
Open

[providers/storyblok] Storyblok focal point filter trips up splitfilters() #170

grgcnnr opened this issue Apr 2, 2025 · 2 comments · May be fixed by #171

Comments

@grgcnnr
Copy link

grgcnnr commented Apr 2, 2025

Focal point doc: https://www.storyblok.com/docs/api/image-service/operations/focal-point

Splitfilters fn: https://github.com/ascorbic/unpic/blob/main/src/providers/storyblok.ts#L31

The storyblok image CDN expects a focalpoint filter to be set like this /m/500x300/filters:focal(1869x1674:1870x1675)
but splitfilters() expects colons to be reserved for seperating filters so it gets confused.

the lightest touch solution to this is to URIEncode the focal filter before splitting.

focal = encodeURIComponent(focal)

Happy to PR somethign if that's helpful

@ascorbic
Copy link
Owner

ascorbic commented Apr 3, 2025

Thanks! That would be great if you could

@grgcnnr
Copy link
Author

grgcnnr commented Apr 4, 2025

#171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants