5

I have in my application some references to Twitter photos.

When the photo is no longer available on Twitter side (see this example: http://p.twimg.com/AmL3hpaCEAd2wtN.jpg), I receive a 404 response code with an image as a body (the gray 404 image)

I'm using onload and onerror javascript methods on Img, but since p.twimg.com is returning a body, the onload method is triggered. I found no way to distinguish a 404 response from a 200 one.

Any idea?

Chris
  • 2,744
  • 3
  • 24
  • 39

1 Answers1

3

Check image size if it's 6.232bytes(Twitter not found image's size) or not.

To find image file size

Community
  • 1
  • 1
totten
  • 2,769
  • 3
  • 27
  • 41