Resize images in Bitbucket wiki pages
Asked Answered
C

2

19

I'm trying to resize the images in the wiki pages and nothing is working: the images are always presented with 100% width of the page.

I tried with reStructuredText:

.. image:: image.jpeg
   :height: 100px
   :width: 200px
   :scale: 50 %
   :alt: alternate text

(and different combinations, ignoring some lines).

Then I also tried

![](image.jpeg =250x)

But, again, it doesn't change the size of the presented image.

Any idea?

Counterpunch answered 13/5, 2019 at 8:34 Comment(2)
Image resizing is currently not supported on BitBucket, see this open issue bitbucket.org/site/master/issues/12877/…Bloomery
Thanks @LorenzoAddazi ! I thought it was just meCounterpunch
K
14

Bitbucket Server 7.5 includes support for defining the size of images in markdown.

[...]

The syntax which is supported is to specify the height and/or width as "key=value" pairs inside curly braces immediately after the markdown for the image, for example:

![alt text for the image](image-file.png){width=50%}
![alt text for the image](image-file.png){height=50 width=60}
![alt text for the image](image-file.png){height=100}
![alt text for the image](image-file.png){width=200px}

See more at: https://jira.atlassian.com/browse/BSERV-7426

Kirov answered 13/4, 2021 at 5:14 Comment(7)
I am trying this by creating a README.md directly in repo and checking the preview, but the image sizes in preview is not changing.Newmodel
hello @BitwiseDEVS, you may want to add a separate question with more details to it; I had tested this solution on bitbucket.org a while ago many times and it worked.Kirov
Could it be possible that changing image size does not reflect in preview and only when the changes is actually applied or commit?Newmodel
Maybe you could try that on a temporary branch to see if it worksKirov
I tried it, unfortunately it really is not working. Can you verify it on your end as well? I am confused as well since this is what they do in their doc. I am currently raising this issue now.Newmodel
I'm using Github now. I do remember having issues trying to edit README.md files on Bitbucket web editor, but it was something different. Maybe they're not giving this feature much love? My suggestion was trying the changes on a temp branch, but don't verify it on the commit preview: verify it by viewing the committed file.Kirov
I tried it, not working even in actual commit. It might be a bug or there is extra work needed.Newmodel
M
0

Be careful where you set the width and height properties.

In my case, the attached image input format is as follows:

[![](){width=50%}]()

example:

[![image.png](attachment:1234/5678){width=50%}](attachment:1234/5678)

Mattoid answered 17/4 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.