Aman Khanna
Aman Khanna

Reputation: 375

image not displaying in HTML

I am trying to display image in an HTML page using img tag. code is :

  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE html 
 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>hi!</title>
 </head>
 <body>
  <div>

     <img src="images/a.jpg" alt="MISSING JPG" /> 
     <img src="images/b.jpg" alt="MISSING JPG" /> 
    </div>
  </body>
 </html>

Image a.jpg is displayed correctly but for b.jpg it diplays "MISSING JPG". Problem comes only on ie 8. On fireforx it works fine. I have verifies location of both image files. Both images open fine when directly clicked. I have tried repairing a.jpg using JPEG repair tool irfanviewer and other phot editors but it doesn't work. I tried to repair image using one of the online image repair tool, then it worked. I have to display large number of jpeg files and all of them are giving problem. Not sure how to repair JPEG files.

I have uploaded a.jpg at loacation "http://s20.postimage.org/s0n2lakq5/image.jpg". It loads fine from this URL but not from disk.

Upvotes: 0

Views: 191

Answers (1)

Scott Sword
Scott Sword

Reputation: 4708

So you are saying the b is showing up, but not a? At first glance you don't have .jpg (all lower-case) for a.

What you have - a.jPG

What you should have - a.jpg

My guess is that modern browsers know what you are trying to achieve here and parse it correctly for you, while older browsers get confused.

If this doesn't fix it, then please upload your images somewhere and provide us a url to its location. Without actually looking at the image itself there is no way to determine if its been compromised somehow.

Upvotes: 1

Related Questions