I'm using IMGKIT in one of my projects and had to use their css with html option to satisfy a requirment. I noticed that if stylesheets are set as follows:
kit = IMGKit.new(html, :quality => 50)
kit.stylesheets << '/path/to/css/file'
and the stylesheet has a background property with a relative url('image.png'), image is not generated when exporting it using kit.to_file:
(Rails.root + "public/pngs/" + "image.png")
The request hangs, and if we replace the background url to full url with protocol, host and port, it is well exported.
Do I need to have absolute urls to all my images in my stylesheet?
I have tried defining asset_host in my development.rb file:
config.action_controller.asset_host = Proc.new { |source|
"#{request.protocol}#{request.host_with_port}"
}
It does replace the url in the css if I check on browser but still the images are not generated when exported through IMGKIT.