Giter Club home page Giter Club logo

Comments (4)

oldcai avatar oldcai commented on May 16, 2024 1

For example

A source image URL could be something like https://www.domain.com/VALIDATION/filename.png

Some browser could support WebP (and some don't), a javascript can check them out.

When the browser supports WebP, and the imgproxy do not care about the extension, the javascript only need to change the URL to https://www.domain.com/VALIDATION/filename.webp

It would be more convenient to use.

from imgproxy.

DarthSim avatar DarthSim commented on May 16, 2024

Hi! Thanks for trying out imgproxy!
What do mean by changing the extension on the user side? Could you give me an example?
The provided extension defines the resulting format of the image, so I can't drop it from the URL. The supported formats list is limited by libvips support.

from imgproxy.

oldcai avatar oldcai commented on May 16, 2024

@DarthSim

I've implemented this feature, I'll pull a request if you have considered it's acceptable.

from imgproxy.

DarthSim avatar DarthSim commented on May 16, 2024

As far as I know frontend, you need to do this replacement before images start to load. To do so, you'll have to put image url to something like data-src instead of src. And if you do so, it's not more complex to generate two URLs, put them to data-src and data-src-webp, and use the one that is best supported by the browser.

Finally, I don't want to break back compatibility for now. So I'm going to close the issue.

from imgproxy.

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.