Different size of images on page than defined using rest API

shroomba
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 16, 2024

Hi,

we are using Confluence rest API to upload images to our Confluence pages. The HTML we send through PUT request is this:

'<ac:image ac:width="800"><ri:attachment ri:filename="{image_file_name}"/></ac:image>'
however the size of the image on the page is 1011.
I then tested different sizes with the same image but with different names, not one of them matched the defined size and also I couldn't find any pattern:
- uploaded 100, size on page 78
- uploaded 200, size on page 196
- uploaded 300, size on page 314
- uploaded 400, size on page 423
- uploaded 500, size on page 549
uploaded 600, size on page 666
uploaded 700, size on page 1011
uploaded 800, size on page 1011
uploaded 900, size on page 1011
uploaded 1000, size on page 1409
Why do sizes not match what we define?
Thank you for your answer,
Sara

1 answer

0 votes
Tomislav Tobijas _Koios_
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
December 16, 2024

Hi @shroomba ,

I've never used this but can you try adding widthType parameter when using PUT request and setting it to pixel? I've just checked JSON format of one page where the image is attached and I can see that, alongside of width value, there's this widthType value stated as well.

2024-12-16 09-56-22.png

Cheers,
Tom

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events