From 97c998946b07c340ac185357bc1efe28c3e87edb Mon Sep 17 00:00:00 2001 From: Michael Ding Date: Thu, 22 Nov 2012 20:30:59 +0800 Subject: [PATCH] determine image with downcase extname --- lib/linguist/blob_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index 7377008d..b4dc988c 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -20,7 +20,7 @@ module Linguist # # Returns a String def extname - File.extname(name.to_s).downcase + File.extname(name.to_s) end # Internal: Lookup mime type for extension. @@ -139,7 +139,7 @@ module Linguist # # Return true or false def image? - ['.png', '.jpg', '.jpeg', '.gif'].include?(extname) + ['.png', '.jpg', '.jpeg', '.gif'].include?(extname.downcase) end MEGABYTE = 1024 * 1024