some png images not load in IE10

2019-04-18 03:37发布

问题:

I am working with a webpage that compatible to IE10. In IE10 some png images are loaded perfectly. but some images are not load(looks like a broken image). But every thing work in FF19. why this happening? any solution for this?

<BODY>
  <img src = "aaa/Test1.png" />
  <img src = "aaa/Test2.png" />
  <img src = "aaa/Test3.png" />
  <img src = "aaa/Test4.png" />
</BODY>

UPDATE :

The problem occurs only when i open the html file locally. If i open with domain images are loaded. Am so confused. Please some one tell me why this happening?

回答1:

So I was having this error as well and my fix was very obnoxious. PNG and JPG files are very similar, in fact they are so similar that you can simply change the file extension and most image viewers and browsers can render the image properly.

My problem was that I had some native .png and a single native .jpg. For some reason we decided that we wanted all of the files to .png so we simply changed the .jpg extension to a .png extension instead of saving the image properly in say photoshop. This worked great as almost every browser was able to decipher what was going on except for of course IE. This was causing some great confusion amongst our team members until we found out what happened.

I would try to open the image that is failing in PS and save it as .png. This is what fixed our problem.

Hope it helps