Hi,
we are using Confluence rest API to upload images to our Confluence pages. The HTML we send through PUT request is this:
We found a solution: in the image tag definition, we added this ac:custom-width="true" and it helped, so now the image tag looks like this: <ac:image ac:width="{pixel_width}" ac:custom-width="true">
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.
Cheers,
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I checked on our page and this width relates to the size of the attachment, not the displaying size of the image, because in our case, the original size of attachment is 2700x1800, but I want it displayed at 600. So, in atlas_doc_format request, I get this:
"content":[{"type":"media","attrs":{"width":2700,"type":"file","height":1800}}]}]
but the image is still sized at 666 on the page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, I can see two width attributes here - one for the displayed image/layout, and one for the actual size.
I've used Jira but not Confluence APIs so I can't say I'm an expert on this.
You might want to check this out with Atlassian Support as they probably have staff who have more knowledge on this.
If you do get this to work, I would appreciate it if you would share the resolution here.
Cheers,
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We found a solution: in the image tag definition, we added this ac:custom-width="true" and it helped, so now the image tag looks like this: <ac:image ac:width="{pixel_width}" ac:custom-width="true">
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cool thing to know 👀
@shroomba thanks for sharing!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.