Warn when image doesn't exist instead of throwing SyntaxError

This commit is contained in:
Joseph Wynn 2019-09-05 14:45:32 +12:00
parent 48c36e75b9
commit 91a540c266
No known key found for this signature in database
GPG Key ID: F34B9E530F0D3AEE
2 changed files with 2 additions and 2 deletions

View File

@ -56,4 +56,4 @@ Feature: Jekyll responsive_image_block tag
path: {{ path }}
{% endresponsive_image_block %}
"""
Then Jekyll should throw a "SyntaxError"
Then Jekyll should throw a "Magick::ImageMagickError"

View File

@ -6,7 +6,7 @@ module Jekyll
def process(image_path, config)
absolute_image_path = File.expand_path(image_path.to_s, config[:site_source])
raise SyntaxError.new("Invalid image path specified: #{image_path}") unless File.file?(absolute_image_path)
Jekyll.logger.warn "Invalid image path specified: #{image_path.inspect}" unless File.file?(absolute_image_path)
resize_handler = ResizeHandler.new
img = Magick::Image::read(absolute_image_path).first