Giter Club home page Giter Club logo

Comments (3)

ascorbic avatar ascorbic commented on June 18, 2024 1

The examples you've given are for the confusingly named Cloudflare Images rather than Cloudflare Image Resizing, which is what the current one handles. I'd not realised that Cloudflare Images supported dynamic resizing too, but I see it can be enabled with "flexible variants". If someone wants to contribute support for the flexible variants syntax with Cloduflare Images that would be great. If that happened, we could add imagedelivery.net to detected domains too.

from unpic.

johneatmon avatar johneatmon commented on June 18, 2024

I see that now, my apologies. Wow! That is confusing then on their part to have similar products with similar names.

I would contribute the syntax myself, but I am afraid my coding skills are not up to snuff. 😅

from unpic.

davedbase avatar davedbase commented on June 18, 2024

I'm using the Image Resizing service as well and having a bit of trouble. I have a properly formatted path for my CF image: https://cdn.romamoulding.com/cdn-cgi/image//https://cdn.romamoulding.com/mouldings/753-1.png however I'm receiving Invalid Cloudflare URL as an error.

This seems related to the strictness of the transformations group requiring certain input. I'd like to recommend making it optional:

https?:\/\/(?<host>[^\/]+)\/cdn-cgi\/image\/(?<transformations>[^\/]+)?\/(?<path>.*)$

I can certainly submit a PR to fix it. Edit: PR is here: #60

The thing about CF Image Resizing is that it also allows you to proxy the requests through a custom worker for serving up images ie. I have this setup: https://images.romamoulding.com/?image=https://cdn.romamoulding.com/mouldings/753-1.png which is equivalent to the above cdn path.

I suppose the way to do this with Unpic is to allow the domain images.romamoulding.com and assert cdn as cloudflare. Wouldn't the Regex however block this allowance though since it doesn't have the cdn-cgi path in it.

from unpic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.