Don’t print a warning when FastImage doesn’t know about a file type
This commit is contained in:
parent
da11eae106
commit
0d806277f9
1 changed files with 3 additions and 1 deletions
|
@ -37,11 +37,13 @@ module Middleman
|
|||
real_path = File.join(images_dir, real_path) unless real_path =~ %r{^/}
|
||||
full_path = File.join(source_dir, real_path)
|
||||
|
||||
if File.exists? full_path
|
||||
if File.exists?(full_path)
|
||||
begin
|
||||
width, height = ::FastImage.size(full_path, :raise_on_failure => true)
|
||||
params[:width] = width
|
||||
params[:height] = height
|
||||
rescue FastImage::UnknownImageType
|
||||
# No message, it's just not supported
|
||||
rescue
|
||||
warn "Couldn't determine dimensions for image #{path}: #{$!.message}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue