unpic icon indicating copy to clipboard operation
unpic copied to clipboard

feat: add support for cloudflare images without custom domain

Open dawaltconley opened this issue 9 months ago • 0 comments

Should fix #111

I wrote this pretty quick, fyi, as a patch for a project where I only need to support imagedelivery.net images.

Flagging the added filter here that removes empty transformation queries.

  const transformString = Object.entries(transformations)
    .filter(([key, value]) => Boolean(key) && value !== undefined)
    .map(([key, value]) => `${key}=${value}`)
    .join(",");

I added this because the current regex would pick up an image variant (e.g. /public) as a query and include it in the transform string (?public=undefined). But this change could potentially affect other cloudflare_image urls if I'm not understanding how their transformation queries work.

dawaltconley avatar May 23 '24 19:05 dawaltconley