Support file size limits #6

Open
nzakas opened this Issue Nov 29, 2009 · 9 comments

Comments

Projects
None yet
4 participants
Owner

nzakas commented Nov 29, 2009

It would be useful to include a file size limit, such that a data URI is not generated if a referenced file in the CSS is larger than a given size.

Probably also a good idea to add a warning in verbose mode when a data URI is longer than 32 KB because IE8 will ignore it.

Seldaek commented Jul 9, 2010

I'd support this, I had to disable embedded stylesheets for IE8 as a result of this issue

Contributor

fearphage commented Feb 23, 2011

The code is already written for this:

JustinTulloss/cssembed@cfc49b4

Contributor

fearphage commented Mar 6, 2011

The 2nd half of this request is addressed in v0.3.4

If you don´t won´t to support IEs (f.e. on a mobile website) it would be nice if this feature is controllable via a parameter.

proposal:
maxfilesize = 1 (default)
maxfilesize = 0 (images are converted regardless the filesize)

Contributor

fearphage commented Mar 30, 2011

Coming back around to this. I'd like to support this request.

"if the encoded image ends up being over 10k, keep the image link."

I may be able to code it even. I'll see when I get some time.

Owner

nzakas commented Apr 7, 2011

I think there are actually two possible useful options:

  1. Don't include the data URI if it's longer than x characters
  2. Don't include the data URI if the image is larger than x kb
Contributor

fearphage commented Apr 8, 2011

I tackled the URI length limit here: #20

Owner

nzakas commented Apr 8, 2011

Cool, I'll take a look this weekend, thanks!

Owner

nzakas commented Apr 13, 2011

Sorry, the weekend got away from me. I'll look at this as soon as I can!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment