Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Retina displays - 404 error when there is no @2x image #231
we are facing a problem with retina.js on retina screens. We have premium template that has no retina images, but we use the script because of our buyers, so they don't have to include it by themselves.
The problem is that template doesn't have retina images, only regular ones. On MAc, retina display, the normal image apears, but script is generating 404 errors in console (as it can't find @2x images). Can you help us to solve this issue. I think that the script should just ignore if there is no retina images, not showing 404 error in console. Here is the link to template in question: http://www.pixel-industry.com/html/trucking/
Thank you in advance.
This is not a bug, it is a feature. On HTTP methods, even OPTIONS, HEAD or GET they obviously return 404 Not Found if the file is not found. Retina.js performs this to check if the file exists to be replaced... So, if you want, you can add data-no-retina to your images tags to avoid requesting the retina version of them. It is in the docs.
Wouldn't it be easier to add a class for images that has hi-res copy and avoid tons of 404 errors that are really bad...