# How are image links generated?

**URL:** https://meta.discourse.org/t/how-are-image-links-generated/118019
**Category:** Support
**Created:** [May 17, 2019, 12:01pm UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019 "2019-05-17T12:01:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![TheBestPessimist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebestpessimist/32/247704_2.png) [@TheBestPessimist](https://meta.discourse.org/u/TheBestPessimist)
#### Post date: [May 17, 2019, 12:01pm UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019/1 "2019-05-17T12:01:35Z")

</div>

Here’s a **large** image:

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg)

Its original link is: [https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg](https://global.discourse-cdn.com/meta/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg)  
Which is different from `![image|690x459](upload://nkjFnpawJaOanmycDbIXVG4jlkn.jpeg) `

It will however, also have multiple _optimized_ (for size and dimensions) versions.  
Here’s one i got: [https://global.discourse-cdn.com/meta/optimized/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b\_2\_690x459.jpeg](https://global.discourse-cdn.com/meta/optimized/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b_2_690x459.jpeg).

My questions are:

- can i link somehow to the image via the “upload link”: `![image|690x459](upload://nkjFnpawJaOanmycDbIXVG4jlkn.jpeg) ` (eg: `https://meta.discourse.org/uploads/nkjFnpawJaOanmycDbIXVG4jlkn.jpeg`) =\> i would expect that discourse will redirect me to the correct url afterwards.
- how can i know what other links/versions of my image are created?  
eg. :
  - `https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg`
  - or maybe `https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/>>>2<<<X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg` (this one doesnt exist)
  - other versions for retina, mobile, idk?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [May 17, 2019, 12:34pm UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019/2 "2019-05-17T12:34:14Z")

</div>

> [@TheBestPessimist](#):
>
> can i link somehow to the image via the “upload link”: `![image|690x459](upload://nkjFnpawJaOanmycDbIXVG4jlkn.jpeg)`

Since it’s a custom URL scheme, that kind of link will only work in a Discourse instance. Plus, if you want the link to actually work, it’ll need to be a link to an image on the same instance.

> [@TheBestPessimist](#):
>
> how can i know what other links/versions of my image are created?

Why would you want to know? In Discourse, there are the “original” and a bunch of thumbnails (what we call optimized) which are mostly generated to support different pixel ratios.

---

<div class="post-metadata">

### Author: ![TheBestPessimist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebestpessimist/32/247704_2.png) [@TheBestPessimist](https://meta.discourse.org/u/TheBestPessimist)
#### Post date: [May 17, 2019, 1:02pm UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019/3 "2019-05-17T13:02:03Z")

</div>

> [@zogstrip](#):
>
> Why would you want to know? In Discourse, there are the “original” and a bunch of thumbnails

Well, i’m mostly interested in getting the original link.

Right now if `Copy link address`:

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/e/ae5eccdc7f57cd2449695c35ac9042e673e937cc.png) on my picture above i get

`https://global.discourse-cdn.com/meta/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg`

which even although has original in the name, is not the same as

`https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg`.

My point is that if in the future discourse would change the cdn, all the links with the old cdn will be broken.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [May 17, 2019, 1:02pm UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019/4 "2019-05-17T13:02:59Z")

</div>

That’s the exact same file (cue the filename), except your 1st link is on the CDN and the 2nd link is on S3 (the storage we use here on meta).

---

<div class="post-metadata">

### Author: ![TheBestPessimist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebestpessimist/32/247704_2.png) [@TheBestPessimist](https://meta.discourse.org/u/TheBestPessimist)
#### Post date: [May 17, 2019, 1:03pm UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019/5 "2019-05-17T13:03:55Z")

</div>

i just modified the post again (sry, i though you werent gonna answer that fast 😊 )

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 18, 2019, 11:42am UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019/6 "2019-05-18T11:42:30Z")

</div>

Click / tap the image and click / tap the download link at the bottom. Problem solved.

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/6/f6de89002d4e0e01a30a90761b40495876ac20f5.png)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [June 17, 2019, 11:42am UTC](https://meta.discourse.org/t/how-are-image-links-generated/118019/7 "2019-06-17T11:42:32Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
