README.md in imgkit-1.3.4 vs README.md in imgkit-1.3.5
- old
+ new
@@ -64,10 +64,24 @@
:quality => 60
}
config.default_format = :png
end
+## 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"
+
+assuming its in that location you can just do:
+
+ IMGKit.configure do |config|
+ config.wkhtmltoimage = Rails.root.join('bin', 'wkhtmltoimage-amd64').to_s if ENV['RACK_ENV'] == 'production'
+ end
+
+If you're not using Rails just replace Rails.root with the root dir of your app.
+
+
## Rails
### Mime Types
register a .jpg mime type in:
@@ -80,10 +94,10 @@
Mime::Type.register "image/png", :png
### Controller Actions
You can respond in a controller with:
- @kit = IMGKit.new(render_as_string)
+ @kit = IMGKit.new(render_to_string)
format.jpg do
send_data(@kit.to_jpg, :type => "image/jpeg", :disposition => 'inline')
end