Checking size of some gifs throws a Zlib::BufError. Tolerate it until we can figure out why.

This commit is contained in:
Neil Lalonde 2013-04-23 14:08:05 -04:00
parent 2e8e4b7c6e
commit 631ed3df58
1 changed files with 3 additions and 0 deletions

View File

@ -161,6 +161,9 @@ class CookedPostProcessor
# return nil when it's an external image *and* crawling is disabled
return nil unless SiteSetting.crawl_images? || uri[0] == "/"
@size_cache[uri] ||= FastImage.size(uri)
rescue Zlib::BufError
# FastImage.size raises BufError for some gifs
return nil
end
def get_image_uri(url)