imgkit

How to convert html map into image (png or jpg )

拥有回忆 提交于 2021-01-07 02:39:58
问题 I am trying to save a map containing markers and also heatmap into an image. Here is the code to display the map. from ipywidgets import Layout import geopandas defaultLayout=Layout(width='3000px', height='3000px') # A very large image. lat_lgn = [39.74248, 254.993622] m_f = Map(center=lat_lgn, zoom=12, layout=defaultLayout) marker_m = Marker(location=lat_lgn, draggable=False) m_f.add_layer(marker_m) m_f Add some markers on it arr_test1 = [39.74258, 254.993682] arr_test2 = [39.76288, 254

How to give fingerprint css path in production rails 4

泄露秘密 提交于 2019-12-18 05:08:10
问题 I am using imgkit to take snapshot of my webpage. I run: RAILS_ENV=production bundle exec rake assets:precompile To precompile my assets. All file of app/assets directory are compiled to public/assets application.css compiled as application-7a23a105125768e41d9d24aee4553615.css . My controller code is: kit = IMGKit.new(render_to_string(:partial => 'form', :height => 200, :transparent => true, :quality => 10, :layout => false,:locals => {:project => @project})) # t = kit.to_img(:png) kit

(Rails) IMGKIT - Issues in exporting images with html and css

只谈情不闲聊 提交于 2019-11-29 08:45:23
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

How to give fingerprint css path in production rails 4

风格不统一 提交于 2019-11-29 07:44:21
I am using imgkit to take snapshot of my webpage. I run: RAILS_ENV=production bundle exec rake assets:precompile To precompile my assets. All file of app/assets directory are compiled to public/assets application.css compiled as application-7a23a105125768e41d9d24aee4553615.css . My controller code is: kit = IMGKit.new(render_to_string(:partial => 'form', :height => 200, :transparent => true, :quality => 10, :layout => false,:locals => {:project => @project})) # t = kit.to_img(:png) kit.stylesheets << "#{Rails.root.to_s}/public/assets/application.css" #file = kit.to_file(Rails.root + "public

(Rails) IMGKIT - Issues in exporting images with html and css

£可爱£侵袭症+ 提交于 2019-11-28 02:24:38
问题 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