# <ac:image> from a URL in Confluence storage format

URL: https://goingstellar.ro/reference/confluence-storage-format/external-images/

An image from a web address is an ac:image containing ri:url with the address in ri:value. Nothing is uploaded and nothing is copied. The ADF form is a mediaSingle node holding a media node of type external, and a save adds alignment attributes and an ac:src copy of the address.

## Storage format

```xml
<ac:image><ri:url ri:value="http://confluence.atlassian.com/images/logo/confluence_48_trans.png" /></ac:image>
```

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
<ac:image><ri:url ri:value="http://confluence.atlassian.com/images/logo/confluence_48_trans.png" /></ac:image>
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "mediaSingle",
   "attrs": {
    "layout": "align-start"
   },
   "content": [
    {
     "type": "media",
     "attrs": {
      "type": "external",
      "url": "http://confluence.atlassian.com/images/logo/confluence_48_trans.png"
     }
    }
   ]
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<ac:image><ri:url ri:value="http://confluence.atlassian.com/images/logo/confluence_48_trans.png" /></ac:image>
```

The external image example from the storage format page.

Rendered view (HTML):

```html
<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://confluence.atlassian.com/images/logo/confluence_48_trans.png" data-image-src="http://confluence.atlassian.com/images/logo/confluence_48_trans.png" loading="lazy"></span>
```

Storage format after the round trip through ADF:

```xml
<ac:image ac:align="left" ac:layout="align-start" ac:src="http://confluence.atlassian.com/images/logo/confluence_48_trans.png"><ri:url ri:value="http://confluence.atlassian.com/images/logo/confluence_48_trans.png" /></ac:image>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<p><ac:image ac:width="200"><ri:url ri:value="https://example.com/logo.png" /></ac:image></p>
```

An external image limited to 200 pixels wide.

Rendered view (HTML):

```html
<p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-external-resource" width="200" src="https://example.com/logo.png" data-image-src="https://example.com/logo.png" loading="lazy"></span></p>
```

Storage format after the round trip through ADF:

```xml
<ac:image ac:align="left" ac:layout="align-start" ac:custom-width="true" ac:width="200" ac:src="https://example.com/logo.png"><ri:url ri:value="https://example.com/logo.png" /></ac:image>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<p><ac:image ac:align="center" ac:layout="center" ac:width="300"><ri:url ri:value="https://example.com/logo.png" /></ac:image></p>
```

An external image centered and 300 pixels wide.

Rendered view (HTML):

```html
<p><span class="confluence-embedded-file-wrapper image-center-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-external-resource image-center" width="300" src="https://example.com/logo.png" data-image-src="https://example.com/logo.png" loading="lazy"></span></p>
```

Storage format after the round trip through ADF:

```xml
<ac:image ac:align="center" ac:layout="center" ac:custom-width="true" ac:width="300" ac:src="https://example.com/logo.png"><ri:url ri:value="https://example.com/logo.png" /></ac:image>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"attrs": {"layout": "center"}, "content": [{"attrs": {"height": 100, "type": "external", "url": "https://example.com/logo.png", "width": 200}, "type": "media"}], "type": "mediaSingle"}], "type": "doc", "version": 1}
```

A media node with its own height and width sent as ADF, centered.

Rendered view (HTML):

```html
<span class="confluence-embedded-file-wrapper image-center-wrapper"><img class="confluence-embedded-image confluence-external-resource image-center" src="https://example.com/logo.png" data-image-src="https://example.com/logo.png" loading="lazy"></span>
```

Storage format after the round trip through ADF:

```xml
<ac:image ac:align="center" ac:layout="center" ac:original-height="100" ac:original-width="200" ac:src="https://example.com/logo.png"><ri:url ri:value="https://example.com/logo.png" /></ac:image>
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- A save through ADF adds ac:align and ac:layout, both set to left and align-start unless the image was centered, and an ac:src attribute that repeats the address.
- The ri:url element and its address are kept as written, including a plain http address.
- A width becomes a pixel width on the mediaSingle node and returns as ac:width with ac:custom-width set to true.
- A media node with a width and height sent as ADF stores them as ac:original-width and ac:original-height, not as ac:width and ac:height.

## Pitfalls

- The page stores only the address. The probe addresses were placeholders and the save and the view still produced an img element, so a dead address is not reported.
- The view marks these images with the class confluence-external-resource, so they can be told apart from attachments in rendered HTML.
- A width in storage adds the class confluence-embedded-manual-size to the wrapper in the view.

## Related

- [Image attributes](https://goingstellar.ro/reference/confluence-storage-format/image-attributes/)
- [Attached images](https://goingstellar.ro/reference/confluence-storage-format/attached-images/)
- [Link bodies: plain text and rich](https://goingstellar.ro/reference/confluence-storage-format/link-bodies/)
- [Alignment and indentation](https://goingstellar.ro/reference/confluence-storage-format/alignment-indentation/)
- [Smart links: inline, card and embed](https://goingstellar.ro/reference/confluence-storage-format/smart-links/)

## Sources

- [Confluence storage format (Atlassian Documentation)](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
- [Atlassian Document Format: document structure (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)

