Edit save_images.rb with
def capture_page_image(browser, url, width, file_name)
width, height = width.split('x')
puts `"#{browser}" #{@config['phantomjs_options']} "#{snap_file}" "#{url}" "#{width}" "#{file_name}" "#{height}"`
endEdit snap.js with
var view_port_height = system.args[4];
page.viewportSize = { width: view_port_width, height: view_port_height};Edit config with
screen_widths:
- 1280x1024
So I went with doing the split in the snap.js file. One side-effect of that hack is that the gallery images are marked with and ordered by the "size" which ignores the 'x' part of the argument
https://github.com/BBC-News/wraith/blob/a660b71a96a422ea8fbc500536c56858a1ac5588/lib/wraith/gallery.rb#L42
so images with the same width are treated as being part of the same set of snaps and only one of the diff images in that set will be displayed. Can be worked around by making sure no two widths are the same, e.g.
http://dev.labs.ft.com/jim/wraith-experiments/shots1/gallery.html