Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add images to Readme.md

Abhijit Tomar August 26, 2015

Hello,

I am trying to add some images to my Readme.md file as

 

![picture](http://stash.xxxxxx.com/projects/zzzzz/img/abc.png)

 

but its not working. when i view the readme, all i see is the plain text

 

![picture](http://stash.xxxxxx.com/projects/zzzzz/img/abc.png)

please help

11 answers

1 accepted

10 votes
Answer accepted
Mibex_Software
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2015

Hi,

You can include an image by specifying the path relative to your repository root directory:

![picture](img/abc.png)

Hope this helps.

Cheers,

Michael

 

Abhijit Tomar August 26, 2015

thanks michael but i still get the plaintext ![picture](img/stormConsole.png) also, i cant seem to be able to escape quotes. i tried using \' but this shows up as \' does stash render markdowns differently ?

Like Kamil_Woś likes this
Mibex_Software
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2015

I've just checked it again: ![Alt text](path/to/your/img.png) works as intended. Do you have it on a separate line?

ipashchenko August 30, 2017

No, it doesn't show image in README on project page. I've tryied both relative links and absolute path to dropbox hosted image (http://*.png) - doesn't work... This is sad. 

Matt Rakestraw September 18, 2017

Ilya, I was having same problem. If I removed all space in front of the tag, my image started showing up. Apparently, you can't indent.

Like # people like this
vdkhanh December 11, 2017

![alt text](images/successful.png)

This worked for me.

NONE April 23, 2018

I had the same problem and tried a lot (relative path, upper/lowercase etc.).

What solved it finally was adding the alternative text.

As Michael said, this is a valid format working locally in editor preview and remote on Stash/Bitbucket:

![alternativetext](subfolder/image.png)

 

Boujraf Youssef May 2, 2018

Dear all,

Same problem since new version of bitbucket.

Last week, no issue to display the picture.

Now, the issue is the picture is not displayed.

To get back the picture, we need :

- Edit the readme.md file

- press CANCEL

Then the picture is displayed again.

 

 Capture.PNG

the path is : ![home](images/home.png)

Thanks if anybody could highlight me about this.

 

Best regards,

Youssef

Like # people like this
techrisala May 2, 2018

Changing my comment to STILL NOT WORKING.

Ian Geiser May 3, 2018

It still will not render correctly on the overview page.

Boujraf Youssef May 3, 2018

Dear

 

Yest it is.

Without :

- Edit the readme.md file

- press CANCEL

No pictures.

 

Best Regards,

Youssef

Michael Neil May 3, 2018

This does not work as intended. Maybe it's working in existing README's but not new ones.

I added an image to my repo in a folder. I added the markdown

![Screenshot](examples/screenshot.png)

When I view my readme on bitbucket I get a broken image link. I opened the inspector and the path/image are correct! The file is requested and returns a 200. Except that the content type is text/html :(

It appears that the markdown parser is interpreting the code incorrectly.

Like # people like this
techrisala May 3, 2018

@Boujraf Youssef Your fix works temporarily. On reloading the page, the images get lost again.

surreal6 May 4, 2018

same problem here, it was working but with the new design the images disappeared...

Mike Makuch August 16, 2018

Same problem here

lionslair August 27, 2018

Anyone work this out yet?

Noah Rodenbeek August 28, 2018

I'm having the same issue. It does work if I go to the Readme file, push Edit, then push Cancel. Otherwise, it's just showing the alt-text and a broken image icon. I mean, if nothing else, can the broken image icon go away and the alt text just behave like it normally would on a website?

anaqui September 21, 2018

It does work, but the problem is it only works in the master branch. If you have a feature branch and try to test it out, it will appear as a broken link. When you merge to the master, your image will show up. Atlassian should fix this.

Like # people like this
Mark Bonsack December 9, 2018

Not only does it only work in the master branch, the image still won't display.  You  have to actually click on the alternate text (which is hyperlinked) to the image file, which then displays properly in a new window.

EDIT:  I had an extra [] pair around the alt-text; weird behavior for sure... 

But still only works with master.

Like Dave Liao likes this
hansiemithun July 31, 2019

can we specify the width and height on this: `![picture](public/images/image.png)`

Like # people like this
6 votes
Mikko Salonen August 29, 2018

Get the full path by navigating to your image file, push 'raw file'-button right of the page, copy the path except for the very end (e.g. image.png?at=refs%2Fheads%2Fmaster). In general the path should be https://......../[project_name]/raw/[image_folder]/[image.png]

bdore September 26, 2018

This works.

Like # people like this
Samuel Ferreira October 18, 2018

This works only in preview mode (while editing the README.md file inside the bitbucket itself)

arshak49 March 13, 2019

Thank you a lot. 

4 votes
DesolanceR October 21, 2019

This works for me:

![ImgName](ModifiedAbsoluteURL)

ImgName = whatever you want

AbsoluteURL = can copy this from browser, go to the image in your repository, open it and copy the link

ex: https://bitbucket.org/*USER*/*PROJECT*/src/master/.../image.png

ModifiedAbsoluteURL = Take the AbsoluteURL and replace "src" with "raw"

 

Now your image should be displayed in the ReadMe.

osman November 17, 2019

Worked for me after trying a million other things. Thanks!

docamp10 June 15, 2020

Worked for me. Thanks!

Liz Medelez July 20, 2020

Thank you very much! this solution worked for me.

Dmitry December 12, 2020

thx very match, u r a wizard! Works in 2021

1 vote
Marcy June 17, 2019

In each repo's Issue Tracker under Settings, I added an image to the "No issue tracker":

Screen Shot 2019-06-17 at 11.51.51 PM.png

That provided a link that I copied and pasted into the repo's Readme.md file. This works for me and is the same technique some use on GitHub.

1 vote
Not Angel Ortiz March 3, 2019

A relative path works just fine, if you are on the master branch.

 

![alt_text](images/your_image_name.png)

 

I changed the README.md file in the development branch, but when pushing changes the images are not showing up. The reason is: because BitBucket looks for the raw images in the master branch.

0 votes
Sidh Regmi May 13, 2020

![picture](img/abc.png) works.

Apparently, it was due to case sensitivity in my case. Changing jpg to caps worked on my test repo. So make sure your path and name of the file is exactly as it is in the repo.

qbrt May 24, 2020

Aparently, bitbucket does not like the minus character when trying to embed an image into a markdown file.

This does NOT  work (has minus char in filename)

![Descrition](folder/file-name.png) works in bitbucket.

This works (minus char removed)

![Descrition](folder/filename.png) works in bitbucket.

 

Cheers

arpit.malhotra June 8, 2020

Could you please tell me how can I directly upload an image to an existing directory. I can add images to a comment description but I don't see a way to add it to any repo.

Sidh Regmi June 15, 2020

You would have to push the image to the repo same way you'd push the code. Cannot add image from the bitbucket UI. You'd have to do it either using sourcetree or git commandline.

Keith Hill February 21, 2021

Has anybody been able to figure out how to get an embeddable build badge to show up in a README?  What we had used to work just fine but since our last Bitbucket server upgrade, it has broken **all** of our README build badges.  This is a #FAIL.

We use Jenkins for builds and its build status images are all served via a URL containing an SVG element. 

Keith Hill February 21, 2021

Hmm,  I think the cause of my problem is that our Jenkins master is HTTP while our Bitbucket server is HTTPS:

https://github.com/jenkinsci/embeddable-build-status-plugin/issues/43#issuecomment-640723861

Keith Hill February 21, 2021
0 votes
Simon Hooper November 11, 2019

Check the case of both the path and filename are correct.

 

I had trouble getting a swagger screenshot to load in our readme.md on bitbucket server. The image was one folder deep from root in the resource folder. Resources/SwaggerUI.PNG

When looking at the md file I had, I noted that the case of the path and file name was wrong.

So `resources/swaggerui.png` did not work but setting the correct case did `Resources/SwaggerUI.PNG` 

## Swagger
Check![SwaggerUI.png](Resources/SwaggerUI.PNG)

 

Tim Black November 13, 2019

Simon, I'm also using Bitbucket Server and can only get images to work in markdown when using paths relative to the current file. repo-relative paths don't work, and external links dont work. Is this your experience as well?

It's rather unfortunate, bc it forces us to put images in our git repos, which is less than ideal. I'm using png exported from draw.io - it would be better if I could refer to the file stored elsewhere IMO.

I don't see anywhere in Bitbucket docs or in community about this limitation.

Simon Hooper December 2, 2019

Yeah our readme is at root too. So we're in the same boat. Could only get the image to render when the path is relative but also when the case matched.

It's rather unfortunate, bc it forces us to put images in our git repos, which is less than ideal. I'm using png exported from draw.io - it would be better if I could refer to the file stored elsewhere IMO.

Could not agree more.

david April 22, 2020

It is 2020, is there any way to resize on bb?

Like sharrikk likes this
DS January 27, 2021

Shouldn't Bitbucket work to support base64 encoded images just like similar readme viewers and editors do?

0 votes
Adam Pankowski September 23, 2019

Removing spaces from the paths solve this issue for me. Still surprising that in 2k19 we still got issues with spaces inside the path.

0 votes
Pedro Freitas December 10, 2018

How does Atlassian even dare to claim projects are migrating from GitHub into here if it does not support such simple feature...

Srikrushna Pal January 17, 2019

It's very simple

Just upload your image to the repository root, and link to the filename without any path, like so:

![your_image_name](your_image_name.png)
0 votes
Dwayne October 8, 2018

This worked for me. I used the absolute path suggested by @Mikko Salonen along with the following format:

.. figure:: https://absolute/path/to/image.png
   :alt: alias of image
0 votes
Noah Rodenbeek August 28, 2018

     

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events