I give up. How do you get Amazon hosted photos to display?

I don’t understand. Sometimes my photos hosted on Amazon show a preview, most of the time they don’t and I can’t figure out why it works when it works or why it doesn’t when it doesn’t.

I 100% of the time have the link on its own line, so I don’t get it.

Any advice?

Can you post examples of when it works and when it doesn’t?

These worked: Pet pictures! - #455 by elfkin477

These didn’t

I didn’t do anything differently with the links, so I don’t know why some work and others don’t

You need to put the URL in a line all by itself.

I always put the url on a line by itself now

In the second instance, Discourse has interpreted whatever you entered as being NOT in a line by itself. To be really sure, make sure there is a blank line both before and after the URL. They have to be totally and completely blank; no spaces or anything that could be possibly interpreted as text.

I’ve had this happen too, and I know to always put the URL on its own line. I just know now that if it’s an Amazon link, there’s a 50-50 chance it’s not going to work.

When I go to post just those links alone on their own lines, each has the message:

Testing:

https://www.amazon.com/photos/shared/TNiLWVn3Q9yaK16MvFH3oA.z0xaDeRx5D0zte97H0HF-3

https://www.amazon.com/photos/shared/hTqtIs0PSDyfez2k8zGLlw.q6FIgU7hkChnNNJt01v1oF

https://www.amazon.com/photos/shared/rXwWeac_T-GC_juQoDrBTg._BVWIOtdJtzfylK52qRQ-Q

https://www.amazon.com/photos/shared/hKgiJjpDT2em0qNmhgtwng.oduIcidfKdwRLPW64aym38

Possibly I got a different result on the first four links because I’m not logged in.

(And now I want a kitten.)

I’m not sure why those links didn’t work, since when I tried it they appeared to work in the preview window when they were on their own line, but the thumbnails didn’t appear in the actual post. However, you can do better than that by clicking on the image to get the full-resolution image, and then (to use an example for Firefox) right-clicking and selecting “View Image”, and then cutting and pasting that URL in your post, on its own line, thus:

Nope, I only get an error message when I try that.

https://thumbnails-photos.amazon.com/v1/thumbnail/9hdMC72BRQqasCXUOdesjw?viewBox=449%2C798&ownerId=ARO9M3O2ROPXK

“Sorry, we were unable to generate a preview for this web page, because the web server returned an error code of 401. Instead of a preview, only a link will appear in your post”

And I also get an error when I don’t open it as a new tab…

https://www.amazon.com/photos/all/gallery/9hdMC72BRQqasCXUOdesjw?sort=sortDateUploaded

“Sorry, we were unable to generate a preview for this web page, because the following oEmbed / OpenGraph tag could not be found: description”

Amazon has photo sharing services? Is there any documenation on this? I’ve never heard of amazon as a photo sharing site.

So this, huh? I don’t know how I’ve used the internet so long and never knew Amazon was also a photo sharing service?

https://www.amazon.com/Amazon-Photos/

I am a Prime customer, so I initialized my account (it’s free for Prime members) and uploaded a large photo. Let me see what it looks like when I share it, via the “share link” button

https://thumbnails-photos.amazon.com/v1/thumbnail/DMlIKlr8S9myWiy1MYIg5A?viewBox=1526%2C1908&ownerId=A1LEXEYZFZ4611

Yeah that’s kind of an annoying URL because it gives no indication it is a picture. If I click on the picture, then right click and select “copy link” I get

https://thumbnails-photos.amazon.com/v1/thumbnail/DMlIKlr8S9myWiy1MYIg5A?viewBox=1526%2C1908&ownerId=A1LEXEYZFZ4611

e.g. the same thing… we’d have to code in custom support for this because those URLs don’t look like typical images of any sort, e.g.

https://example.com/picture.jpg

My apologies; I don’t see any easy way around this at the moment, even the usual “add .jpg to the end” doesn’t really work. It’s a shame Amazon chose such a weird way to implement this!

Maybe it’s on purpose? They might want people to go to their site rather than casually posting photos they’re hosting on other sites.

As a semi-complete aside, @elfkin477, may I say that Poe was an absolutely adorable kitten (made me go “awww!” with grabby hands) and has become a stunningly gorgeous cat.

Yes it does look like this is the case. Turns out we merged the previous change a while ago, so Discourse properly looks at the content-type of the URL regardless of what the URL looks like, e.g. https://example.com/image.jpg.

The SD poster is saying that it works about 50% of the time. I’d be willing to make a bet that Amazon has some stuff going on in their backend that tracks the groupShareToken such that it is only valid for a limited period of time/views and/or IP locked, etc.

Basically: I seems as though Amazon is trying to tell us it doesn’t want to be a service that hosts images for you to embed directly in to other sites.

I tried a bunch of ways of generating “image links” and none of them work, so I think Amazon is indeed saying they are not interested in being an image embedding service.

Sorry!

Testing…

Amazon does appear to allow embedding pictures, as in the above post. It’s just the OneBox that is flakey.

In the preview of this post it tries to OneBox the below URL and gives the error:

Sorry, we were unable to generate a preview for this web page, because the following oEmbed / OpenGraph tag could not be found: description

https://www.amazon.com/photos/shared/TNiLWVn3Q9yaK16MvFH3oA.z0xaDeRx5D0zte97H0HF-3

Ok, but the URL for the above image is

https://thumbnails-photos.amazon.com/v1/thumbnail/JEhO9T7pQVCyCEwzAgFPDg?viewBox=1830,1220&ownerId=ARO9M3O2ROPXK&groupShareToken=rXwWeac_T-GC_juQoDrBTg._BVWIOtdJtzfylK52qRQ-Q

So there’s a bunch of extra “stuff” in there:

  • Viewbox dimensions
  • Owner ID
  • Group Share Token

My guess is the one with the group share token is the way, but I don’t know how to generate that from my one photo that I have stored on Amazon photos.