Giter VIP home page Giter VIP logo

Comments (3)

hamishwillee avatar hamishwillee commented on July 18, 2024

This is a good idea, but I'd be tempted by a warning box rather than just a note.

@evilpie Is there an approximate image size in some meaningful unit (pixels?) at which we can tell people they really need to worry? Or is it a matter that always recommending via toBlobUrl makes sense?

from content.

the-chandru avatar the-chandru commented on July 18, 2024

Hello @evilpie / @hamishwillee , Can I pick this issue? Please note that, I am starting to contribute to OpenSource for the very first time :)

from content.

gijsk avatar gijsk commented on July 18, 2024

@evilpie Is there an approximate image size in some meaningful unit (pixels?) at which we can tell people they really need to worry? Or is it a matter that always recommending via toBlobUrl makes sense?

I'm not @evilpie but I'd suggest just always recommending toBlobUrl. data URIs, even at smaller sizes, mean that the browser has to keep a copy of the data as a string (as you can call getAttribute on the image where you assign to src, or read its src property), which duplicates the contents of the data. Even though a 1MB data URI "works" pretty well in browsers, it's a lot of data that the browser has to copy around in memory etc. blob URIs are always more efficient.

Of course data URIs have their place for e.g. 1x1 pixel things but as long as any warning isn't overbearing that seems fine to me.

from content.

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.