Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CssCompressor fails to compress asset with a DATA-URI #3

Closed
bndn opened this issue Dec 3, 2012 · 2 comments
Closed

CssCompressor fails to compress asset with a DATA-URI #3

bndn opened this issue Dec 3, 2012 · 2 comments

Comments

@bndn
Copy link

bndn commented Dec 3, 2012

I use SASS ans Compass to generate a data-uri with the Compass method inline-image() and the command compass compile. The CSS file is generated then I call it in the css_asset_tag, but the JekyllAssetPipeline fails to compress the file depending of data.
The following content is compressed :

.favicon{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAU1QTFRFAAAAdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fcl5F9o449Y039Y039Y44dl9Fdl9Fdl9FdV9FbVxGimZD9Y019o029ZE+9ZA89Yw09Y02dl9Fdl9Fdl9FcV1Gc15Fh2VE+ZVB+Ktp+rqC+rh/+Kdi9Y02dl9Fdl9Fdl9F9I02+ZI7+8+n+sKR9Y03dl9Fdl9F9owz96FY9pZF9Yw0dl9Fdl9F9Ys096FX9pdI9Yw0dl9Fdl9F/I4z951R/NKs9pI+9Y01dl9Fdl9F04E7+7uD+8aX+K1v9Y44dl9Fdl9Fdl9FdV9Fb11GbVxGsXM8+pZD+Khk+KZh+KZi9phJ9Yox9Y449Y44dl9Fdl9Fdl9Fc15FbVtGhGRE9o439osz9Yw09Yw09Yw19Y449Y449Y44dl9F0n849Y869Yw09Yw19Ysy////tCdKpAAAAGh0Uk5TANBR/Gr1ZvZdP2lZGyVSThzvjsH59XWa/Pn8+IHmyTMMGYDtVBYedYnt4A9X+zJeQvd8u7vrlfRkzJ7ZrNOhm9UR+KZjSTtyAqWeAqCfZnfT7dmLcnbO9PepZ9bz6aMgRsbs6Kwpo4Z+Zc+fAAAAAWJLR0RuIg9RFwAAAAlwSFlzAAA")}

but not this one, with only one more character ! :

.favicon{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAU1QTFRFAAAAdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fdl9Fcl5F9o449Y039Y039Y44dl9Fdl9Fdl9FdV9FbVxGimZD9Y019o029ZE+9ZA89Yw09Y02dl9Fdl9Fdl9FcV1Gc15Fh2VE+ZVB+Ktp+rqC+rh/+Kdi9Y02dl9Fdl9Fdl9F9I02+ZI7+8+n+sKR9Y03dl9Fdl9F9owz96FY9pZF9Yw0dl9Fdl9F9Ys096FX9pdI9Yw0dl9Fdl9F/I4z951R/NKs9pI+9Y01dl9Fdl9F04E7+7uD+8aX+K1v9Y44dl9Fdl9Fdl9FdV9Fb11GbVxGsXM8+pZD+Khk+KZh+KZi9phJ9Yox9Y449Y44dl9Fdl9Fdl9Fc15FbVtGhGRE9o439osz9Yw09Yw09Yw19Y449Y449Y44dl9F0n849Y869Yw09Yw19Ysy////tCdKpAAAAGh0Uk5TANBR/Gr1ZvZdP2lZGyVSThzvjsH59XWa/Pn8+IHmyTMMGYDtVBYedYnt4A9X+zJeQvd8u7vrlfRkzJ7ZrNOhm9UR+KZjSTtyAqWeAqCfZnfT7dmLcnbO9PepZ9bz6aMgRsbs6Kwpo4Z+Zc+fAAAAAWJLR0RuIg9RFwAAAAlwSFlzAAAA")}

I do not understand what is the problem :/

@matthodan
Copy link
Owner

Interesting problem. Couple of questions: Which library are you using (e.g. Closure Compiler, YUI, etc.)? Can you compress the CSS file manually from the command line using this library? Is it throwing an error when you run the jekyll command?

@bndn
Copy link
Author

bndn commented Dec 3, 2012

I use YUI Compressor. Compressing the CSS file from the command line give an error too : YUI::Compressor::RuntimeError: compression failed. The error from Jekyll is Asset Pipeline: Compiling bundle...Failed to compress asset with 'JekyllAssetPipeline::CssCompressor'.

But I found that the problem is from YUI Compressor 2.4.4 included in ruby-yui-compressor. I tried with the version 2.4.7 from yuicompressor and it works.

And I’m not the only one that have this problem : sstephenson/ruby-yui-compressor#19

I should have looked better before reporting a problem here :)

@bndn bndn closed this as completed Dec 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants