lib/capybara/screenshot/diff/stabilization.rb in capybara-screenshot-diff-0.8.1 vs lib/capybara/screenshot/diff/stabilization.rb in capybara-screenshot-diff-0.8.2
- old
+ new
@@ -17,10 +17,10 @@
return false;
}()
EOF
def reduce_retina_image_size(file_name)
- return if !macos? || !selenium? || !Capybara::Screenshot.window_size
+ return if !ON_MAC || !selenium? || !Capybara::Screenshot.window_size
saved_image = ChunkyPNG::Image.from_file(file_name)
width = Capybara::Screenshot.window_size[0]
return if saved_image.width < width * 2
height = (width * saved_image.height) / saved_image.width
resized_image = saved_image.resample_bilinear(width, height)