57

I'm having trouble adding a .gif to a question or answer in our Stack Overflow Team site.

I've used the following tooling to add the .gif, and it plays in the preview window, but when it's actually applied to the question or answer, the extension is .png.

For example:

enter image description here

As you can see here, it's working, so why does the file extension automatically get changed from .gif to .png while using our team site?

enter image description here

In response to an answer below, the .gif I am trying to post is only 7KB.

4
  • 6
    For the vast majority of animated content, WebM/VP9 (lossless or lossy) is far more efficient than GIF. And it also doesn't force the author to mangle the image to 256 colors palette. Commented Jun 9, 2018 at 12:07
  • 1
    Animated GIF's can get huge quickly (I use them a lot!). Not sure about on Teams, but elsewhere the limit is 2MB. Alternatively you can host the image somewhere like your own imgur account and then include the link with an ! in front in your post, then there is no size limit.
    – ashleedawg
    Commented Jun 9, 2018 at 16:35
  • @ashleedawg I can confirm the size is small, under 1MB. There is something different happening on the Teams site that is causing the .gif to be changed to .png. From what I've read is our team site is in it's own schema, so it would be great if all of our pasted content (photos or otherwise) was contained in the same place. I'll try referencing a gif on my own imgur account and see if that resolves the issue, but ultimately I'd still like to know if this is a bug, is "works as expected", is "future supported feature", etc... Would be nice to know "why" this is happening for the team site.
    – Brien Foss
    Commented Jun 9, 2018 at 17:26
  • 1
    The path breakdown (roughly) to the image while using StackOverflow For Teams is: https://stackoverflow.com/<letter>/<teamName>/images/<letter>/<GUID>.png. Still leaves the question on whether *.gif is supported on SOForTeams or is the extension being changed automatically to *.png because it is not.
    – Brien Foss
    Commented Jun 11, 2018 at 16:02

4 Answers 4

20

For security reasons, Teams does not use Imgur. We host the images ourselves.

At the moment, the tool we built for images does not support gifs. Images are processed and re-encoded as PNGs.

However, we definitely should support them! It's on our roadmap, but we haven't yet scheduled it to be built.

6
  • Perfect, thank you and we will keep our eye out for this in the future!
    – Brien Foss
    Commented Jun 12, 2018 at 15:01
  • 1
    I take it this one hasn't made it to the top of the Trello board yet. We're brand new to Teams, and I was attempting to upload a GIF to demonstrate a UI procedure. In April plans, maybe? Also, this limitation should probably be in the Teams documentation.
    – Andrew
    Commented Mar 27, 2019 at 20:17
  • This is really puzzling. I selected an animated GIF for upload in Teams and the preview displayed the animation. Only then when I finished the upload it was static. It took me quite a while to figure out what was wrong, and eventually locate this explanation (but only after I had spent enough time that I finally noticed that this was apparently what was happening).
    – tripleee
    Commented Sep 24, 2020 at 7:40
  • This was the first major thing that made SO for teams not perfect. It adds a lot to visually show processes when answering questions. Commented Apr 6, 2021 at 20:20
  • 2
    It's 2022 and 4 years later and any form of animated image format still does not exist!
    – Oliver
    Commented Feb 14, 2023 at 8:09
  • I wonder when this will be implemented. It's 2024 and we still can't have gifs on SO for teams.
    – Victor
    Commented Mar 4 at 14:19
33

I create and edit a lot of animated GIF's, and the filesize can quickly get huge; I suspect that could be part of the problem.

Not sure about on Teams specifically, but elsewhere the limit is 2MB. Alternatively you can host the image somewhere like your own imgur account and then include the link in your post with a ! in front, like:

![My Caption](https://i.sstatic.net/4gWax.gif)

...and then there is no size limit. You could also use the html syntax like:

<img src="https://i.sstatic.net/4gWax.gif">

...or more complex and combined with a link, like:

[<img src="https://i.sstatic.net/4gWax.gif" width="70" height="70" title="Click to enlarge.">](https://i.sstatic.net/4gWax.gif)

...which produces:


Incidentally ScreenToGif is free, handy and open sourced, for creating GIF's of screen recordings and more, and ezgif will optimize the GIF's, reducing file size by up to 90%.

9
  • I appreciate the feedback and ideas, I'll need to talk to our team to see if referencing pictures on another imgur account is worth the effort or if just still photos is good enough. We might not have a business need enough to create an SOP for how to post animated gifs to a question or answer.
    – Brien Foss
    Commented Jun 9, 2018 at 17:28
  • 27
    In general, having the user use their own hosting for images should be discouraged. Doing so leaves the post at the mercy of the off-site resource remaining available. There are lots of questions which loose their utility due to such resources becoming unavailable (either intentionally, or unintentionally).
    – Makyen Mod
    Commented Jun 9, 2018 at 21:24
  • 19
    I would expect a commercial product to have a better solution than "find somewhere else to host it". The content hosted on teams may be confidential and not suitable for hosting on random third party providers Commented Jun 10, 2018 at 14:12
  • 1
    @MartinSmith - I agree 100%. Is the basis for why I even bothered asking at all. If the result is that we must spread out our content across sites, we likely would just conform to the constraints provided at the moment because the Teams concept is one we enjoy a lot and is proving to be beneficial for many items. A new software developer joining our team has a place to go for common knowledge Q&A content that they'll know once they've been spun up on how the business works and how we doing things. Nonetheless, I agree that having all content collectively together is our preferred choice.
    – Brien Foss
    Commented Jun 10, 2018 at 15:13
  • 1
    @MartinSmith: The normal upload-image feature already uses imgur. Using your own account on imgur instead of SO's account is less good, but maybe not as bad as a totally different hoster. Commented Jun 11, 2018 at 3:42
  • I don't know if imgur counts as "hosting off-site" seeing as that's where "all" of Stack Overflow's images are hosted. Also, that would only be required for files in excess of Stack Overflow's 2MB image limit... a limit that they could likely be willing to increase for "paying clients"... Alternatvely you could host internally, especially if security is an issue. (Keep in mind I'm not speaking on behalf of Stack Overflow!)
    – ashleedawg
    Commented Jun 11, 2018 at 14:14
  • 4
    Imgur would be considered hosting off-site in relation to Teams. Teams does not use Imgur to host images - they're hosted on our own servers to protect any content within them from public view.
    – animuson StaffMod
    Commented Jun 11, 2018 at 14:44
  • 1
    @animuson Perfect, then the 2mb limit won't apply.
    – ashleedawg
    Commented Jun 11, 2018 at 14:52
  • @animuson yes, confirmed. The path to the image is not Imgur. I've made a comment on my question regarding the path breakdown from what I can see.
    – Brien Foss
    Commented Jun 11, 2018 at 16:04
6

Just to spell out the half-obvious workaround, you can upload an animated GIF in StackOverflow and then link to it from Teams.

  • Start composing a new question on Stack Overflow, or find a post on Stack Overflow where you can post an answer (you don't have to actually post it).
  • Add your animated GIF to the post you are composing.
    • There is a size limit, currently 2 MB. See the other answer for options for reducing the size.
    • When you have added the image successfully, you should be able to copy its URL from the composition pane where you are typing the new post.
      [![enter image description here][1]][1]
      
      
        [1]: https://i.sstatic.net/w3xLr8.gif
      
  • Paste the image URL into your Teams post. If you already tried to embed an image, you should see something like
    ![enter image description here](https://stackoverflow.com/a/abc/images/s/c131c986-2264-41c7-98ad-669e3059e1fc.png)
    
    Replace the URL in the parentheses with your new GIF image URL.
    ![enter image description here](https://i.sstatic.net/w3xLr8.gif)
    
  • Cancel the post on Stack Overflow proper where you uploaded the GIF (or just close that browser tab).
  • Go ahead and finish your Teams post with a nice animated GIF.
4
  • Will Stack Overflow host this animated GIF forever, even though there's no reference to it in a non-Teams Stack Overflow question/answer? Or will it eventually get "garbage collected"? Commented May 31, 2022 at 19:32
  • 1
    @RobBednark That's an excellent question. Based on what I see elsewhere, I would expect it to stay up. For example, images from long-deleted spam posts are still hosted. But it might be worth posting a separate question (or finding an existing one) to clarify the retention policy.
    – tripleee
    Commented Jun 1, 2022 at 2:53
  • 2
    @tripleee That may be the case for old spam, but images in new spam/offensive posts will be deleted. Mods can also request images be deleted manually. (There's some sick stuff that's been posted.) Moral of the story: Don't put your images in your spam posts or something.
    – Laurel
    Commented Sep 28, 2022 at 21:57
  • @Laurel Thanks for the update. I discovered as much empirically the other day (much to my disappointment!) but forgot that we had discussed that here. Thanks for the link to more info!
    – tripleee
    Commented Sep 29, 2022 at 4:11
4

Unfortunately, at this time SOE does not support the upload and storage of animated GIFs within its internal system and there are no known plans to implement it as of yet.

A way that you can use an animated GIF in your answer is to upload it to an external image hosting service and use Markdown image tags to embed the image in your answer. Of course, uploading confidential/proprietary images to a public provider like imgur.com or giphy.com may not be allowed in your organization due to security policies, so please be mindful of what content you upload.

Steps for the above option:

  1. The GIF needs to be hosted on an external platform (e.g. Giphy)
  2. Enable the Markdown editor when answering your question in SOE by using the switch at the top right of the editor area.
  3. Use the following syntax to include the animated GIF:

Format:

![GIF_description](URL_of_GIF)

Example using an animated GIF hosted on Giphy of Chandler from Friends dancing:

Chandler Dancing

We have passed your question on as a feature request for review for future consideration.

1
  • 2
    @Lundin: This is specifically for Teams. (As noted elsewhere in this Q&A, GIF uploads already work on the public sites.) Sometimes it's helpful to show screen recordings of how to do something or what happens when you try to do something. There are legitimate uses, at least on Teams :)
    – V2Blast Staff
    Commented Oct 12, 2022 at 17:25

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