From 0d806277f9c81c004d7b7cded71cd177e9b55231 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sat, 20 Oct 2012 21:18:42 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20print=20a=20warning=20when=20Fa?= =?UTF-8?q?stImage=20doesn=E2=80=99t=20know=20about=20a=20file=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/middleman-more/extensions/automatic_image_sizes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/middleman-more/lib/middleman-more/extensions/automatic_image_sizes.rb b/middleman-more/lib/middleman-more/extensions/automatic_image_sizes.rb index d2039fdd..927e8f07 100644 --- a/middleman-more/lib/middleman-more/extensions/automatic_image_sizes.rb +++ b/middleman-more/lib/middleman-more/extensions/automatic_image_sizes.rb @@ -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