How are image links generated?

Here’s a large image:

Its original link is: https://assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/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://d11a6trkgmumsb.cloudfront.net/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://assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg
    • or maybe https://assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/>>>2<<<X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg (this one doesnt exist)
    • other versions for retina, mobile, idk?

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.

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.

1 Like

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

Right now if Copy link address: image on my picture above i get

https://d11a6trkgmumsb.cloudfront.net/original/3X/a/3/a37df25f15fccd47dc543f3d5751d81cb61dbe6b.jpeg

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

https://assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/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.

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).

1 Like

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

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

image

2 Likes

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