Support » Plugin: WP Retina 2x » [Plugin: WP Retina 2x] Nexus 7: Client Side vs. Server Side Issue

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Sorry for my late reply and thanks a lot for your message and also the nice comments 🙂

    I don’t own a Nexus 7 so it is going to be hard to try it for me directly. But let’s start with the basics: using the server-method, if you turn on the DEBUG mode in the plugin settings, then load the page with your standard computer, are the images returned much bigger? (you’ll have to use the Chrome Developer Tools for that for example). I just wonder if the server-method works on your website, so if you have an iPad or a Retina display available somewhere maybe you can try.

    Then if this is not working, then there is a problem with the plugin using the server-method on the Nexus 7. Something that we can try is to modify the high-res screen detection in the server side to match the one found in the client-method one. Very easy to do! Just replace the file “retina-images.js” with this:

    // Retina Images from http://retina-images.complexcompulsions.com/
    // Modified by Jordy Meow (inspired by the retina.js script).
    var root = (typeof exports == ‘undefined’ ? window : exports);
    document.cookie=’devicePixelRatio=’+((root.devicePixelRatio === undefined) ? 1 : root.devicePixelRatio)+’; path=/’;

    Let’s see if it works 🙂

    Hey,

    Sorry for the late reply, I’ve been really busy.

    I swapped out the code you requested and I’m still getting the same results.

    Works just fine and great on the iPad 3rd gen as well as the MacBook Retina!

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hello Phoenix,

    Sorry for the late reply, I was a bit busy recently, I’m willing to make a fix for this ASAP but I didn’t have time to look into this issue in details as… simply put… I don’t own a Nexus 7 and I don’t know anyone who has one.

    Is there a website that looks nice on the Nexus 7? Maybe that would be a first place to look at solutions. The plugin handles already all the big issues and adding support for that device would be one line of code maximum I believe, but… I still need to figure out what it is 😉

    Thanks a lot for your help!

    Hey Jordy,

    I manage a couple of sites that I’ve used CSS media queries to swap out non-retina background-images. However, I have noticed, that the following code will not register on the Nexus 7:

    only screen and (-webkit-min-device-pixel-ratio: 2)

    However, this modification made the @2x background display:

    only screen and (-webkit-min-device-pixel-ratio: 1.3)

    I’m not sure if this sheds any light on the issue, but I hope it helps!

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hey Phoenix,

    It makes perfect sense. Based on that, I tried, and you are very right, the server-side doesn’t handle this. Give me one hour or two 🙂

    Plugin Author Jordy Meow

    (@tigroumeow)

    Please open the file “wr2x_image.php”, and before the line with the “require…” copy-paste this:

    // Retina Images doesn't handle the float value for the cookie devicePixelRatio, so let's ceil it!
    	if ( isset( $_COOKIE['devicePixelRatio'] ) ) {
    		$_COOKIE['devicePixelRatio'] = ceil(floatval($_COOKIE['devicePixelRatio']));
    }

    It will work 🙂 I will update the plugin soon but I want to do another little modification before that.

    Plugin Author Jordy Meow

    (@tigroumeow)

    Plugin updated! It should me available in your WordPress already. Tell me if it works 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP Retina 2x] Nexus 7: Client Side vs. Server Side Issue’ is closed to new replies.