javascript - Check for empty image -


i have folder full of .jpg images. php script i'm reading list of images in folder , i'm displaying them on browser.

the problem of images exist, it's wrong them. few kb can't displayed (on browser see broken image), of course if download these images in local can't see them.

i tried google found how recognize broken link or empty img tag, how can check if image displayable? tried onerror event isn't fired.

imo, you’d better off checking on server, using php. php has several functions load images, such imagecreatefromjpeg , imagecreatefrompng. both these functions return false if there’s error loading image. getting false tell it’s not valid image.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -