0

I have a PHP site that allows a user to search for and display images. Images come from a variety of sources and as such, some are blocked by a web filtering service.

Site is aimed at multiple users that will like have different web filtering servicew.

How can I determine if the image is displayed or not?

Have tired getimagesize(), get_headers(), file_exists() with no luck . These functions report the image details correctly (I get a 200 OK response etc.), however the webfiltering then blocks the image from being shown.

My current process is cURL the image search request (using Google's image search API), json decode the results and then display images with their remote URL as the src.

I could save all the images to my server for each search request, but that seems too bandwidth intensive.

cwallenpoole
  • 79,954
  • 26
  • 128
  • 166
Mike Thrussell
  • 4,175
  • 8
  • 43
  • 59
  • 1
    try something like this: and imgError(string) should be a function that uses ajax to report to the server that the user didn't see the image – ITroubs Mar 18 '13 at 14:39

1 Answers1

1

try something like this:

<img src="image.gif" onerror="imgError('image.gif')"> 

and imgError(string) should be a function that uses ajax to report to the server that the user didn't see the image

ITroubs
  • 11,094
  • 4
  • 27
  • 25