README.md in jekyll-assets-0.11.0 vs README.md in jekyll-assets-0.12.0
- old
+ new
@@ -235,10 +235,41 @@
```
[amazon-s3]: http://aws.amazon.com/s3
+### Images size (dimension) auto-guessing
+
+The image helper accepts options param (in square brackets) with `autosize`
+switch. If given, then image dimension will be calculated and
+apropriate attributes set:
+
+``` html
+{% image logo.png alt="Logo" [autosize] %}
+
+<!-- assuming logo.png is 50x50, the above will render -->
+
+<img src="/assets/logo-68b329da9893e34099c7d8ad5cb9c940.png" alt="Logo"
+ width="50" height="50">
+```
+
+You can also globally enable `autosize` in config (see `autosize` config option
+below). In this case, `image` tag will alway render dimension attributes unless
+you specify `no-autosize` switch. Assume you have `autosize` option enabled in
+config, then:
+
+``` html
+{% image logo.png [no-autosize] %}
+{% image logo.png %}
+
+<!-- assuming logo.png is 50x50, the above will render -->
+
+<img src="/assets/logo-68b329da9893e34099c7d8ad5cb9c940.png">
+<img src="/assets/logo-68b329da9893e34099c7d8ad5cb9c940.png"
+ width="50" height="50">
+```
+
### Custom Compressors
Sprockets comes with good set of preconfigured compressors, but imagine you are
not satisfied with default settings. For example you want to strip all comments
but copyrights info. In this case you can define and use your own compressor.
@@ -547,9 +578,15 @@
#
# Sets CSS compressor. No compression by default.
# Possible variants: 'yui', 'sass', nil
#
css_compressor: ~
+ #
+ # Globally enables adding image width and height attributes to image tags.
+ # Does nothing if either width or height attribute already set.
+ # Disabled by default.
+ #
+ autosize: false
#
# Sets cachebusting policy for generated assets.
#
# Possible variants:
#