whoaaallamapajama
whoaaallamapajama

Reputation: 101

HTML or Javascript Questions - Image Test

I have a list of hundreds of festivals and I'm trying to determine how to effectively use an if statement to test when:

this type of page - http://www1.sk-static.com/images/media/profile_images/events/18704054/col4

is different than this

this type of page - http://www2.sk-static.com/images/media/profile_images/events/18709809/col4

As you can see in the the top link, there is no image, but actually there is... it is a blank image. I have a back-up image in this case but I can't seem to figure out how to test if the image is blank or not since both links are valid with 'images' on them.

Upvotes: 2

Views: 107

Answers (2)

ashok_p
ashok_p

Reputation: 749

You can test the memory size of the image, if you are using any server side scripting language.

as i can see from you above images first image(blank) is of size 237 Bytes where as second image is of size 87.9 KB

as blank image size is less you can check the size and show alternative image.

see this question this may help you

determining image file size dimensions via javascript

Upvotes: 1

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85575

You can test for the image name which is blank image and obviously this image will be where the blank image would be. So if you get background image with such name apply your condition.

Upvotes: 0

Related Questions