FIX: rescue login required / broken images

This commit is contained in:
Arpit Jalan 2018-01-11 22:17:06 +05:30 committed by Neil Lalonde
parent f752c22104
commit a13b8182e9

View File

@ -237,7 +237,8 @@ class CookedPostProcessor
return unless SiteSetting.crawl_images? || Discourse.store.has_been_uploaded?(url) return unless SiteSetting.crawl_images? || Discourse.store.has_been_uploaded?(url)
@size_cache[url] = FastImage.size(absolute_url) @size_cache[url] = FastImage.size(absolute_url)
rescue Zlib::BufError # FastImage.size raises BufError for some gifs rescue Zlib::BufError, URI::InvalidURIError, URI::InvalidComponentError
# FastImage.size raises BufError for some gifs, leave it.
end end
def is_valid_image_url?(url) def is_valid_image_url?(url)