FIX: show original imgur image (not cropped one)

FIX: show original imgur image (not cropped one)

By default imgur includes cropped image link in OG tags as per facebook specified size. We do not want to show cropped image for image links so we are removing fb parameter from image links.

diff --git a/lib/onebox/engine/imgur_onebox.rb b/lib/onebox/engine/imgur_onebox.rb
index dc5c2e0..922853d 100644
--- a/lib/onebox/engine/imgur_onebox.rb
+++ b/lib/onebox/engine/imgur_onebox.rb
@@ -58,7 +58,7 @@ module Onebox
 
         <<-HTML
             <a href='#{escaped_url}' target='_blank' rel='noopener' class="onebox">
-              <img src='#{og.get_secure_image}' #{og.title_attr} alt='Imgur' height='#{og.image_height}' width='#{og.image_width}'>
+              <img src='#{og.get_secure_image.chomp("?fb")}' #{og.title_attr} alt='Imgur'>
             </a>
           HTML
       end

GitHub sha: 3c872255

1 Like