retina.js

Suppressing 404s in retina.js library

吃可爱长大的小学妹 提交于 2019-12-31 12:59:27
问题 We use the js lib retina.js which swaps low quality images with "retina" images (size times 2). The problem is, that retina.js throws a 404 for every "retina" image which can't be found. We own a site where users can upload their own pictures which are most likely not in a retina resolution. Is there no way to prevent the js from throwing 404s? If you don't know the lib. Here is the code throwing the 404: http = new XMLHttpRequest; http.open('HEAD', this.at_2x_path); http.onreadystatechange =

Changing retina.js retina image path

人盡茶涼 提交于 2019-12-12 04:54:41
问题 When using images on a site, retina.js automatically looks for an image in the same folder with the same name with the added @2x , and then swaps out if the user has a high-DPI screen. What I am trying to do is to tell retina.js to instead look for this retina @2x image in a sub folder. So if I'm using image.png , I want retina.js to look for image@2x.png in a subfolder named Retina for example. I won't get into why I need this, but that is the gist of it. So then, is this possible, and where

Rails asset pipeline retina @2x and cache buster timestamps are at odds

空扰寡人 提交于 2019-12-04 18:09:02
问题 retina.js looks for an image with the same filename but with @2x before the file extension The rails asset pipeline adds a cache busting timestamp to the end of the filename This means retina.js is looking for filename-cachebuster@2x.png but the file is at filename@2x-cachebuster.png Anyone have a work around for this? Who's wrong on this ie, should retina.js be trained to look for files at filename@2x-cachebuster.png if the original filename matches a pattern that indicates it has a cache

Suppressing 404s in retina.js library

跟風遠走 提交于 2019-12-02 22:05:23
We use the js lib retina.js which swaps low quality images with "retina" images (size times 2). The problem is, that retina.js throws a 404 for every "retina" image which can't be found. We own a site where users can upload their own pictures which are most likely not in a retina resolution. Is there no way to prevent the js from throwing 404s? If you don't know the lib. Here is the code throwing the 404: http = new XMLHttpRequest; http.open('HEAD', this.at_2x_path); http.onreadystatechange = function() { if (http.readyState != 4) { return callback(false); } if (http.status >= 200 && http

How to test a website for Retina on Windows without an actual Retina display?

爱⌒轻易说出口 提交于 2019-11-27 16:45:51
Is there a way to simulate a Retina display on Windows to test a website for HiDPI displays such as Retina? I run Windows on a standard 24" 1920x1080 monitor. Last night I checked out my website on a friends brand new 15" Retina MacBook Pro and the graphics looked all blurry (far worse than on a regular 15 inch MacBook), while the font was super crisp and sharp, making the logo appear even worse because of the direct comparison. I have followed this tutorial to make my website Retina ready: http://line25.com/tutorials/how-to-create-retina-graphics-for-your-web-designs I used the retina.js

How to test a website for Retina on Windows without an actual Retina display?

谁说胖子不能爱 提交于 2019-11-27 04:09:30
问题 Is there a way to simulate a Retina display on Windows to test a website for HiDPI displays such as Retina? I run Windows on a standard 24" 1920x1080 monitor. Last night I checked out my website on a friends brand new 15" Retina MacBook Pro and the graphics looked all blurry (far worse than on a regular 15 inch MacBook), while the font was super crisp and sharp, making the logo appear even worse because of the direct comparison. I have followed this tutorial to make my website Retina ready: