unveil icon indicating copy to clipboard operation
unveil copied to clipboard

Not working for retina display images on ipad Mini

Open hemkaran opened this issue 10 years ago • 3 comments

I am using this library for loading @2x images for retina display devices. But it is always giving me images without retina display even in retina devices.

I came to know that problem was in window.devicePixelRatio, which is not available in ipad Mini safari.

I resolved this issue by adding a method to check for retina images.

hemkaran avatar May 06 '14 19:05 hemkaran

@hemkaran - Are you able to share the code you used to fix the issue?

wpexplorer avatar May 22 '14 19:05 wpexplorer

I have changed "retina" variable assignment to.

retina = isRetina();

function isRetina() { var query = '(-webkit-min-device-pixel-ratio: 1.5),
(min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(min-device-pixel-ratio: 1.5),
(min-resolution: 144dpi),
(min-resolution: 1.5dppx)'; if (window.devicePixelRatio > 1 || (window.matchMedia && window.matchMedia(query).matches)) { return true; } return false; }

hemkaran avatar May 29 '14 05:05 hemkaran

@hemkaran - nice thanks!

wpexplorer avatar May 29 '14 22:05 wpexplorer