I have ShareX installed and configured to upload screenshots to Imgur (not Stack Imgur, for perhaps obvious reasons; just Imgur).

Chat likes to mangle those links by cutting the image hash part short. For example this image URL:


Gets rendered like so:

<a rel="nofollow" href="//i.imgur.com/7zct02.png">
  <img src="http://i.imgur.com/7zct02s.png" class="user-image" alt="user image">

Actual message on chat with the mangled link. The image is embedded properly, but clicking on it gets you a 404.

Chat notices that the hash ends with an s (7zct02s) and thinks the link goes to the thumbnail version of the picture. It tries thus to be helpful and link to the actual picture. However, the thumbnail URL version is actually 7zct02ss. I believe it's likely that chat doesn't expect Imgur hashes to be 7 characters long, especially when most imgur images on chat are 5 character long stack.imgur hashes.

The same happens with m, l, t and whatever other characters imgur uses to automagically resize pictures.

  • @marcgravell is this really fixed? Because I can still reproduce it
    – Braiam
    Commented Sep 1, 2014 at 12:32
  • @Braiam it doesn't incorrectly truncate; it does, however, still correctly truncate. That example is the second bracket. Commented Sep 1, 2014 at 12:46
  • @MarcGravell why not adding answer explaining what exactly was done? Commented Sep 1, 2014 at 19:00
  • @Shadow because it was so close to one of the existing answers Commented Sep 1, 2014 at 21:06
  • @Marc I see, didn't notice. Maybe edit the answer then, adding something like "This is now implemented"? Commented Sep 1, 2014 at 21:12
  • @MarcGravell Could you leave an answer anyway? We have two answers that say totally different things; an answer of "This is what we did" is helpful. Commented Sep 1, 2014 at 23:57
  • As much as I consider the current solution dangerous I'll accept the answer that describes it in order to satisfy your need for clarity.
    – badp
    Commented Sep 1, 2014 at 23:58
  • 1
    @doppelgreener Cole's answer: is basically what we did; if we suspect that somebody has posted a thumbnail, we check for the existence of the parent image; so if you post 7zct02s, we check for 7zct02; if that exists, 7zct02s is indeed the thumbnail of it, so we use it. Otherwise, we leave it alone. Commented Sep 2, 2014 at 8:21
  • 3
    We are still seeing incorrect behavior. Specifically, chat.stackexchange.com/transcript/message/18139466#18139466. The thumbnail displays correctly, but the link points to a 404. Commented Oct 14, 2014 at 1:08

2 Answers 2


Considering Stack Exchange uses the Imgur API, they should query Imgur to see if an image with that hash exists instead of blindly stripping the trailing character. If the image exists, leave the URL alone.

For your example, SE would query to see if an image with the hash 7zct02s exists.

Then, display the thumbnail, but link to the full size image.


Chat should avoid employing this kind of magic altogether; allowing people to link to a different image than they onebox breaks expectations and can potentially lead to this sort of abuse.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .