diff --git a/lib/ferrum/page/screenshot.rb b/lib/ferrum/page/screenshot.rb index f7adcb5f..90cdf1a7 100644 --- a/lib/ferrum/page/screenshot.rb +++ b/lib/ferrum/page/screenshot.rb @@ -224,9 +224,7 @@ def format_options(format, path, quality) format ||= DEFAULT_SCREENSHOT_FORMAT format = format.to_s - unless SUPPORTED_SCREENSHOT_FORMAT.include?(format) - raise Ferrum::InvalidScreenshotFormatError, format - end + raise Ferrum::InvalidScreenshotFormatError, format unless SUPPORTED_SCREENSHOT_FORMAT.include?(format) format = "jpeg" if format == "jpg"