Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Google Chrome 9 not show images from Amazon S3?

If you go to this site, you'll notice a big image in the middle.
If you inspect it, you'll see this.

<img src="http://s3.amazonaws.com/mosaicimages/hmn58067pa">

If you hover over it during Inspect mode, you'll see this:

img[480x640]

And that's normal. The picture should display.

But sometimes, when I browse my site, the image simply does not display. The HTMl is the same. Everything is the same. It's just that the "cache" messes up.

This is what it looks like: http://i52.tinypic.com/1190xu0.jpg

When the image doesn't display, I clear the cache in Chrome browser settings, and the image displays again. After browsing the site again, random pictures disappear.

It's weird because when you inspect it, the code is the same. However, the image says:

img[0x0]

That's very awkward, because the image really is there. it's in S3 and it's fine. It happens on other pages as well, not just this page. It happens for all images that are in S3.

Some of you may not be able to reproduce it. Some of my friends reproduce it. but if you can, please help, thanks.

Edit: I found a few bug issues related to Chrome? Is this it?

http://code.google.com/p/chromium/issues/detail?id=67373&can=1&q=image%20304&colspec=ID%20Stars%20Pri%20Area%20Feature%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS

http://code.google.com/p/chromium/issues/detail?id=68622

Edit: everything works fine in incognito mode.

like image 619
TIMEX Avatar asked Feb 06 '11 05:02

TIMEX


People also ask

Why are images not working on Chrome?

Clear Chrome Cache and Browsing Data Therefore, it's worth clearing your browser's cache and other data to see if that helps fix your image loading problem. Select the three dots at the top-right corner in Chrome and choose History > History. Select Clear browsing data in the sidebar on the left.

How do I show an image from my Amazon s3 on my website?

Easiest thing to do is make them public in s3, at least read-only. If you don't want them to be public on s3, for whatever reason, you could add a cloudfront distribution that will serve the images from your s3 bucket, and you can give cloudfront access to the files, without making the images public in s3.


1 Answers

Do you get the following warning in the console?

Resource interpreted as [something] but transferred with MIME type [something else]

It may happen if an image is loaded dynamically (i.e. img src changed at runtime on the client) - which was nicely responded to here.

This could also be caused by the browser actually receiving an incorrect MIME type declaration - I don't imagine that would be an S3-specific issue (given the apparently wide range of similar problems encountered) and would rather suggest it could be an issue with a forwarding (corporate?) proxy etc. - this was the case for us when including fonts but never with images.

like image 132
Oleg Avatar answered Oct 07 '22 13:10

Oleg