README.md in imgkit-1.3.8 vs README.md in imgkit-1.3.9
- old
+ new
@@ -1,6 +1,5 @@
-
# IMGKit
Create JPGs using plain old HTML+CSS. Uses [wkhtmltoimage](http://github.com/antialize/wkhtmltopdf) on the backend which renders HTML using Webkit.
Heavily based on [PDFKit](http://github.com/jdpace/pdfkit/).
@@ -55,21 +54,53 @@
Note: Ruby's buffered I/O means that if you want to write the string data to a file or tempfile make sure to call `#flush` to ensure the contents don't get stuck in the buffer.
## Configuration
-If you're on Windows or you installed wkhtmltoimage by hand to a location other than /usr/local/bin you will need to tell IMGKit where the binary is. You can configure IMGKit like so:
+### `wkhtmltoimage` binary location
+If you're on Windows or you installed `wkhtmltoimage` by hand to a location other than `/usr/local/bin` you will need to tell IMGKit where the binary is. You can configure IMGKit like so:
+
# config/initializers/imgkit.rb
IMGKit.configure do |config|
config.wkhtmltoimage = '/path/to/wkhtmltoimage'
+ end
+
+### Default image format
+
+May be set to one of [`IMGKit::KNOWN_FORMATS = [:jpg, :jpeg, :png, :tiff, :tif]`](https://github.com/csquared/IMGKit/blob/d3755e2c23ba605da2f41e17f3edc99f3037d1c7/lib/imgkit/imgkit.rb#L2)
+
+ config.default_format = :png
+
+### Prefix for `<meta>` tag options (see **Usage**) :
+
+May be changed from its default (`imgkit-`):
+
+ config.meta_tag_prefix = 'imgkit-option'
+
+### Additional default options
+
+Any flag accepted by `wkhtmltoimage` may be set thus:
+
config.default_options = {
:quality => 60
}
- config.default_format = :png
- end
+For a flag which takes no parameters, use `true` for the value:
+
+ 'no-images' => true
+
+For flags with multiple parameters, use an array:
+
+ :cookie => ['my_session', '123BADBEEF456']
+
+### Overriding options
+
+When initializing an `IMGKit` options may be may be set for the life time of the `IMGKit` object:
+
+ IMGKit.new('http://example.com/form', :post => ['my_field', 'my_unique_value'])
+
## Heroku
get a version of `wkhtmltoimage` as an amd64 binary and commit it
to your git repo. I like to put mine in "./bin/wkhtmltoimage-amd64"
@@ -213,9 +244,26 @@
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.
+
+## Testing
+
+Make sure the tests pass in the following ruby versions:
+
+ - 1.8.7-p370
+ - 1.9.2-p290
+ - 1.9.3-p194
+
+You can simply
+
+ $ rbenv-install <version>
+ $ rbenv shell <version>
+ $ bundle
+ $ bundle exec rake
+
+For each version
## Copyright
Copyright (c) 2010 <a href="mailto:christopher.continanza@gmail.com">Chris Continanza</a>
Based on work by Jared Pace