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