unpic icon indicating copy to clipboard operation
unpic copied to clipboard

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

Open grgcnnr opened this issue 9 months ago • 2 comments

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

grgcnnr avatar Apr 02 '25 20:04 grgcnnr

Thanks! That would be great if you could

ascorbic avatar Apr 03 '25 06:04 ascorbic

#171

grgcnnr avatar Apr 04 '25 00:04 grgcnnr