Search code examples
htmlimagewebjpegbroken-links

JPG file not loading in webpage


I have a basic webpage that references four image files using the following code:

<img src="/images/SanFran.jpg" name="urbanForm" alt="urbanFormA" width="150" height="100"/>

(I change SanFran.jpg, to London.jpg, NewYork.jpg and Barcelona.jpg - just replacing the filename)

However, although the 4 jpegs are very similar (200 x 150 pixels) and made using a similar technique (cropping an image in Picassa), only one of the files will load (London.jpg). The other three give me a broken link message. I have checked that I am do not have misspellings numerous times, and cannot find the problem.

Is there anything that I have not considered?

(I'm using Aptana Studio on OSX and viewing it using Safari as a previewer; the same problem exists if I look at it using Firefox or Chrome)


Solution

    1. Try naming one of the others SanFran.jpg. See what happens. Might give you a clue.

    2. Open them all in windows explorer, confirm the images themselves load normally and aren't corrupt.

    3. Check all are in /images/

    4. right click on the broken link and choose view image or copy image location. See if where it's trying to access is definitely the right place.

    5. Do the same with the working one. Compare and see if any differences.

    6. change everything to lowercase, just in case (excuse pun)

    7. hit ctrl+shift+reload a few times, and F5 a few times.

    8. clear cache manually if you know how or have the tools.

    9. Copy it to a different loacation and try loading them there. Ideally a different computer.

    10. Upload it somewhere and see if it works in your browser when online

    Hopefully one of those may help...