Gravatar

Retina Displays & WordPress

Written by | July 6, 2012

Retina Displays are all over the place now, and I’m a few hours from getting my new MacBook Retina. Did I really need such a computer and display? I am not sure. But I am certain that this is a step into the future, and it’s a chain of events I wanted to be part of. More importantly, I want Totoro Times to shine on Retina Displays.  So I had to understand the technology, use it, then develop the tools I am missing.

So what’s the heck with Retina, why can it be a pain in the arse for the Web, and how to take advantage of it? Let’s explore the subject.

A NEW TECHNOLOGY?

Retina Display is not really a new technology itself, but just a fancy name given by Apple. The real technology behind it is actually simply a super high-resolution IPS screen that squeezes more pixels together. For example, the new MacBook Pro 15” Retina has an amazing screen resolution of 2880 x 1800 pixels which is twice the resolution of the normal one. Wow, everything must look damn small, right? Well, maybe not.

MacBookPro Retina

THE APPLE TRICK

Some people might be interested in using this new amazing resolution as it is (you can now have 4 Internet browsers next to each other instead of one), but most users wouldn’t : everything would look ridiculously small and your eyes will start hurting. So what is the trick here? It is very simple: to double the size of every elements on the screen! This is an awesome idea: all the elements will look the same way as before, except the fact that they will be delightfully crispy with a much higher definition and the text will have a fantastic anti-aliasing.

This is also exactly where the nightmare begins: all the image sizes will have to be doubled at the back than the sizes shown on the screen! What does this mean? Did you ever try to stretch an 320×213 image to 640×426 ? The result first is a performance loss (your retina device will need to perform the re-sizing) and second a huge quality loss; Retina requires double the resolution, which mean the actual size required for displaying a 320×213 is 640×426. And if we do not have it here, we are losing half the pixels to show a nice picture. That would not be acceptable for most of us!

My normal image at 320×213.

WP Retina 2x - Before

The previous image first re-sized at 640×426
then re-sized again at 320×213, now we can see what it looks like on Retina.

WP Retina 2x - After

This is not very good, is it ? If you don not have a Retina device, you can still go at the Apple Store and try it yourself (most of the websites/pictures you see will be blurry like the above).

THE WEB NEEDS AN UPDATE

All the software will be updated to support such a trick display, this is certain. But what about the Web? Well, every single webmaster will have to take care of this matter him/herself.

The way we develop a website will remain the same. Only everything on your website will have to be doubled, and if you try with Safari and Chrome, they already look nice on Retina, except the images.

The task for the webmasters now, is to prepare and deliver images that are twice the size of the current display sizes of images on the website. And as for now, I can think of 3 ways of doing that:

  • The Hybrid Method. The browser requests the server for an image called “neko.jpg”. Depending on what kind of client it is – retina display or not – the server will return either the image stored as “neko.jpg” or a doubled-size image called “neko@2x.jpg” (the “@2x” is the way Apple wants us to name our retina image when programming on iOS devices so let’s use it). I personally think this method is ideal. It requires some coding on the server side (an image handler), and a way for the server to know when it is dealing with a Retina device (a line in JavaScript to create a cookie).
  • The JavaScript Method. We could have a JavaScript file reacts when it detects a Retina device. It would have to parse the DOM (the object composing your web page) and for each image and request the server for a “@2x” version of the image. Nothing to do on the server-side, the script only will be enough. It is alright for simple and not so dynamic websites, but for blogs it might not be the way. It also uses way more requests and more bandwidth, which will in the end slow down the loading speed of your website dramatically. It seems it is the method Apple website is using (look into the source code of the website, and check the file “images.apple.com/global/ac_retina/ac_retina.js“).
  • The Server Method. I’ve never seen this idea anywhere yet but here it is. On the server, before delivering the content, the HTML would be parsed and the images extracted. For each image, it would check if a “@2x” image exists, and if it does, it would update the HTML with the link to the Retina images. This would be smooth and fast, the only issue here is that we wouldn’t be able to use cache anymore. Or maybe there will be a way to do so, but we are not there yet.

It seems that for now there is no perfect way in achieving this. But either way we will need those double sized files to exist in the first place. Then once we have the files ready, we can start experimenting, and try to make our website look awesome on those high resolution displays.

THE WORDPRESS PLUGIN: WP RETINA 2X

I wanted to get my files created automatically and easily, then to have my websites handle those new displays perfectly. And most importantly, I want the web to look beautiful on my own Retina display! I checked the existing plugins and scripts, but they are all achieving only one part of what I want, with not much support, and everything felt very far away from a nice solution including all the methodologies, features and tools. That is why I created WP Retina 2x.

I will start with the most important piece of advice at this point: DO NOT USE THE WORDPRESS “FULL SIZE” IMAGE DIRECTLY, EVER. The original image is a base for the other sizes on WordPress, and might be only seen when the user click on the image to see a bigger version. From that original image, other image sizes are created depending on your WordPress settings (Settings -> Media). If you need more image sizes, there are many plugins to do so.

So now, how does WP Retina 2x work? First you need to install it, then go check the Basics settings. In my case, I only use the thumbnail, the medium, and large sizes. The other sizes are related to my theme, and I don’t need Retina for them. Please opt-out the sizes you do not need in Disabled Sizes. You can then check Auto Generate, this will create the “@2x” images automatically whenever you upload or replace them.

WP Retina 2x - Settings 1

The Advanced settings let you choose a method. We have seen them before, and I recommend you using the first one. Then you can tick “Debug Mode” if you always want to have Retina images delivered : this is useful to test your website even if you don’t have a Retina device (you can check what kind of images is downloaded from the server).

WP Retina 2x - Settings 2

The next step is to create all those Retina files for your existing images. Check the new menu in Media where you will find the Retina Dashboard. You can click on Generate for all files and if you are lucky, that will be all you need to do! But quite likely you will be asked  to Upload bigger pictures. Retina requires an original image that is equal or more than double the size of the image size you are showing.

WP Retina 2x - Dashboard

PS: This “Upload” button will only appear if you have installed the “Enable Media Replace” plugin, which I strongly advise you to do so.

Are the icons clear enough for you? You can hover over with your mouse to know a bit more about them. Basically, the tick tells you everything is fine, the clock means that the plugin is ready create the @2 files but you need to click on Generate first, the exclamation point tells you that the original file resolution (you can see it on the left, under the image name) is too small, and here in our example above it says that a minimum of 800×800 is required. The others small icons simply indicate that those sizes are ignored by the system (later we can think about having a few more options here, there are always webmasters with special cases).

The Retina Dashboard is mostly used at the beginning, right after you installed the plugin, but it can also be used for troubleshooting purposes. Most of the time, of course, you will only be using the Media Library. Please notice that there is a Retina column available now.

WP Retina 2x - WP Media Library

The Media Library will always keep you informed of any issues with your files. If everything is set up correctly at the beginning then you will not have to do anything other than your normal tasks. All you need to do is to understand how it works from the start then everything will be smooth and magical.

That is my advice: understand how WordPress works with images exactly (using the image sizes), adapt your website accordingly, understand how the plugin works, and then you will have nothing else to do at all. And again, my most important piece of advice: never use the “Full size” image, I am sure now you understand why. Please now make your website beautiful as well

DOWNLOAD & THANKS

Check it out on the WordPress Plugins Repository: WP Retina 2x.

Please comment or contact me directly if you need any help, new features, or when you find any annoying bug.

Comments

  • http://twitter.com/Th0masKim Thomas Kim

    Waiting for 4k now !

    • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

      It’s already here!

    • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

      Do you mean 4x? :p

    • Bunny Evans

      4K screens are nice. We had one at DSJ. The problem is there’s no standard for 4K yet. And the bandwidth you need for 8 million pixels a frame. It is nice thought, you can make 3D without glasses fairly easily. Still too expensive for the end user though.

      • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

        I didn’t knew there was screen and TV with such a resolution I would like to see a movie on such a screen (but you need to have an extra bluray x 2…). But the point it has nothing to do with this article, as the way the Retina display works is a “trick” (to double everything and to end-up with a pseudo-fake resolution). I just though there was something “new” again already, which was a bit surprising.

  • https://profiles.google.com/u/0/zoskitwit Gaël

    All this work… for a type of screen. That’s not the matter here but do you think it’s normal to made all this work for a new hardware ? May be retina screen is future but all this work for one product ! If an other brand do a new screen too ?! Will u add a plugin to your wordpress too ?

    • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

      Actually it is clearly the future: Retina is just the name used by Apple but the other makers will have their own Retina very soon as well, it’s just a matter of time. And about a new plugin for each brand: of course not, why? It will be exactly the same work for the webmasters, nothing different. Get ready for the already-available Retina devices, and it will work on all the future others screen, whatever their name will be.

  • Neal

    Fascinating article – thank you and for all your work on the plugin and the explaination. Very helpful. So this plugin, along with using a responsive wordpress design will make sure than whoever is viewing your site, whether it’s on an iphone, ipad, large pc screen etc, will be served a website that fits well onto their screen and the images will always look sharp, clear and sweet?

    • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

      Thank you Neal Yes, you are quite right, if your design is “responsive” (handle touch devices well) and your WordPress is using this plugin, your website should always be perfect on every single device on the market. I wondered for a while before using the term “Retina” in the name of the plugin, as even it is true, is is not exclusive.

  • Pingback: Entre réel et numérique » Macbook Pro Retina et Lightroom

  • http://twitter.com/paulsearle Paul Searle

    Jordy, thanks for the plugin. Quick question, I’m trying to upload the @2x for a specific size in my theme that is 220×170. I have it unchecked in the preferences and when I upload an image that is 440×340, I only get the clock thumbnail and not a check mark when I hit generate. Any suggestions? It’s the one on the bottom called “family”. Thanks.

    • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

      Hey Paul! I am sorry, I found a bug today, corrected it, and released a new version. That should work now (with the new current version: 0.2.9). Please try and tell me if it works for you

      • http://twitter.com/paulsearle Paul Searle

        Thanks for fixing that so quickly. It does generate the retina now for all of them. One feature request, a search option within the Retina Dashboard would be really helpful.

        • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

          I actually have this one on my todo list, so you can expect this in one of the future updates

  • clineco

    Hi -
    When I upload a large image a few @2x images are not generated am I doing something wrong? When I click generate nothing happens. Attached are some screen shots.

    https://dl.dropbox.com/u/7949988/downloads/retina/retina_settings.png
    https://dl.dropbox.com/u/7949988/downloads/retina/imgsz.png
    https://dl.dropbox.com/u/7949988/downloads/retina/dashboard.png

    https://dl.dropbox.com/u/7949988/downloads/retina/ftp.png

    Thanks!

    • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

      Hello Clineco. I checked your issue and tried to reproduce the bug: indeed, I found the culprit! Thanks a lot, that report was really helpful. Would you mind trying again? I release a new version (0.2.9). Thanks again

      • clineco

        Works perfect! Great job on this plug-in. It has been great watching it’s progress.

        • clineco

          One thing I notice is once my images are generated, the images that are on a gradient background appear to have gradient banding when viewed on the iPhone 4s. I haven’t been able to test on the iPad. If I resize the images manually through photoshop, I don’t have this issue. Thoughts on this? Example: http://tiny.cc/lrplhw

          • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

            I checked your URL on my MacBook Retina. The first image looks great (it is obviously the Retina version), but yeah it I look closely at it I see some kind of radial banding (I really didn’t notice it at first). The second one has more of a vertical banding. Can you share with me the original?

          • clineco

            Sure. Here you go.

          • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

            I tried on my WordPress installation (+ the plugin) but I didn’t get this banding at all. The plugin actually uses the internal re-sizing functions of WordPress and PHP, so it might be related to the configuration of those… but honestly, I have no idea. You updated the images on your website, right? I can’t see the banding there anymore.

          • clineco

            Actually I didn’t. But I also noticed it banding sometimes, then other times it looks fine. Maybe it an iPhone thing?

          • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

            Weird! I saw slight banding when I was looking at your website with the MacBook Retina, but I don’t see any using my iPhone or my “normal” PC screen at work.

  • ThomBrooks

    I’ve got the plugin installed and it is generating the appropriate images. However, when I surf to a page with a new iPad, I am not being served the correct images.

    After some poking around I noticed this thread (this WordPress is a one-click ‘easy’ install on DreamHost):

    https://discussion.dreamhost.com/thread-134657.html

    So if they are automatically sticking this ‘SetHandler no-handler’ line in an .htaccess file in my wp-content directory, then is that what is preventing the server-side method from working?

    I did also try turning on debug mode and also changing settings to client-side mode, but I still don’t think I’m being served the proper images.

    Also: I saw that it tries to write to a log file when you have debug mode turned on. Where should I be seeing that file? If you can please document the location where it SHOULD be, then I can try to figure out why it is not being written to (or touch it and make it world-writable so it can collect some data.)

    Thank you!

    • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

      I’ve never heard of this “SetHander no-handler”, but did you try without it? But even with that, if you’re using the client-method + debug-mode it should really load those @2x images.

      The debug-mode doesn’t write any file. But you can enable logging on the server-handler. Edit the file “wr2x_image.php” and change DEBUG to true. Then a log file will be written in the plugin directory when you are trying to load the files. If no file is being generated, then the handler is probably not called.

      First I think we should try our best so that the client-method works. It’s easy, it must work What is your URL?

      • ThomBrooks

        Well, I enabled DEBUG in the wr2x_image.php file; I also tried creating that retinaimages.log file 666, just in case it didn’t have permission to create it;

        Anyway the site is workshop (dot) vrs (dot) md/?page_id=10 and the bio picture original file is 1339 x 1964. So it made the small and medium just fine, and I have it in there as 204×300. I am watching the access.log file live (with tail -f) and am seeing the iPad requesting the non-@2x version of the graphic.

        I’m not seeing requests for any of the .js files from the plugin, btw.

        Out of curiosity, which method do you think is better if you have to detect on the client side, js or css?
        @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
        only screen and (-o-min-device-pixel-ratio: 3/2),
        only screen and (min–moz-device-pixel-ratio: 1.5),
        only screen and (min-device-pixel-ratio: 1.5) {
        }

        • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

          Using the server-method, the “normal file” will be requested but the high-res one will be returned, and you will not be able to see it on the access.log (only in the retinaimages.log).

          Using the client-method however, you would. Did you try it? The client-method should be tried first, then the server-method.

          On the client-side, I would definitely go for most of the things (at least the whole theme) in CSS, using @media. The plugin should be used for the images in the posts.

          • ThomBrooks

            Well then I do not know what else to try. I have preferences set for client mode. retinaimages.log is still 0 bytes. Even with debug mode setting checked, it is still serving the normal version of the file to both my MBP (non-retina) and my new iPad (is retina.) In Chrome on the MBP I can ‘Inspect Element’ and see that the image that was served is the normal image, not the @2x version.

            What have I got left? Maybe I should be questioning some even more basic things just to see how far along it is getting.

          • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

            Using the client-mode the retinaimages.log wouldn’t grow (the server handler is not used). But there is something strange, on your website I don’t see the retina.js getting loaded as it should be… I have no idea why, that script should load! Are you using some weird HTML caching or something else?

          • ThomBrooks

            I just tried it again using a different theme that was included with DreamHost’s one-click install process (it’s called ‘Ambiru’) and it appear to have finally worked.

            Previously I was using a theme that my friend found online and he liked – however, it was free, and written in 2008(?) so perhaps it was not authored in a way that is compatible with more modern versions of WP, and/or your plugin?

            Thanks for testing it out. Can you see it now?

          • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

            Yeah now it is properly loaded! I will still have to see it with my Retina display later tonight as now I am using a standard and boring computer A theme from 2008?! Wow, and WP changed so much since then. Surprising it is actually even still working

          • ThomBrooks

            Hmm, for completeness’ sake I switched debug mode off and set it back to ‘server’ mode, and it didn’t work anymore. retinaimages.log is still empty. Let me know if you want me to gather any data. Thanks!

          • http://totorotimes.wpengine.com/ Jordy Meow • Japan & Urbex

            Yes this is another issue, I am not sure what. Can you contact me directly via Totoro Times? You’ll find a contact form on the “About” page.

  • Pingback: WordPress Retina Images - WPMU.org

  • Pingback: Wp Retina Pictures | web design at allalla

  • http://www.vgrevolution.com John L

    Great plugin, works smoothly. Only issue I seem to be having is with non-wordpress uploaded images, my logo for example. I did the suggested steps and created a larger retina version and uploaded it tot he same directory with @2x and it’s not swapping out.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hey John! You’re welcome Actually the plugin works with the images that you create as well… so if the plugin works already with the “media” images, it must work with the others you upload. Did you try the client-method? (which uses retina.js). Please share the URL with me.

      • http://www.vgrevolution.com John L

        I replied to that open thread on the WP forums about others having a similar issue, figured thats an easy route to talk about this.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Sorry, I didn’t see your message before. Is it working now? Otherwise can you give me the URL?

  • Dougal Graham

    Hey! Cool plugin, but unfortunately I can’t get it working. This may be out of scope for you, if so, sorry! I’m currently just testing to see if I can make my theme’s images play nicely with this plugin (they can’t).

    I tried turning on logging (no luck for some reason), and I’ve tried both client and server-side.

    Server-side does not appear to work at all, and client-side does replace the images, but for some reason sets them with width and height of 0px.

    I think I’ve figured out why. Some of my images are hidden by default, but show up later from JS (these happened to the first ones I tested). Using jquery’s hide apparently sets their element’s width and height to 0px.

    But there’s another problem, even when they aren’t hidden it doesn’t work correctly. The images are 40px high and wide, but the “offsetWidth” (and height) attributes, which include padding, to set the new width and height, so the images end up appearing wider or higher depending on how much (if any) padding they have.

    OK, I’m running this on the most recent wordpress on Lighttpd, on OS X…

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hello Dougal! Ha, I think you have a special case here It works as long as the images have their size set. jQuery doesn’t hide the photos using a size equal to 0, it would mess up with the overall design plus there would be probably a performance issue as well. I think it always uses the opacity to hide the elements.

      It has nothing to do with the fact that you are running Lighthttp, and OSX, I think the problem comes only from your theme. Do you mind if I have a look at your website somewhere?

      • Dougal Graham

        Thanks for the reply, I’m actually using a personal theme that is under development and I’ve only tried the plugin on my development area on my computer. But the site is at http://www.tfiaa.com if it’s helpful.

        I got the JS version working by replacing offsetHeight/width with regular height/width, which seems to work regardless of whether or not image size is specifically set, or set in css. But, my main concern is getting the server-side version working… Does the plugin do anything to .htaccess or need to modify any files or anything like that?

        • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

          It’s excellent you got the client-side method working with your theme! Most people use this method it seems, as it is the one used by WordPress.com as well. Yes, the plugin modifies the .htaccess and adds one line, did you see anything happening to your file when enabling the server-side method?

          • dougalg

            OK, my Lighttpd setup isn’t using .htaccess, (all my rules are in the lighttpd conf file) so I’ll look into that and see if Lighttpd can even use .htaccess files and let you know.

          • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

            Are you using Lighttpd on your production server as well? I am using the WordPress API and I don’t modify the .htaccess directly… but don’t you have issues with WordPress Permalinks?

          • dougalg

            Yes I am. WordPress’s permalinks work fine using lighttpd’s own style of rewrite rules that go in the conf file rather than an htaccess.

            Do you mean you use the API to modify to .htaccess? If that’s the case, it definitely won’t work on Lighttpd. It looks like I should be able to just hack the project for use in lighttpd so I’ll try that. Thanks!

  • KilgoreTrout

    I was using the client side option, because I also used CloudFlare. When I did my testing at the apple store, I noticed the retina machines would first load the low res image and after a while the high res image would display. I didn’t like the lag time so I decided to get rid of cloudflare and just use the server side option. Went back to the apple store and on the rMBP it worked very well, but on the iphone and the iPads the high res images are no longer displaying, just the low res. Have you noticed this problem?

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hey Kilgore! I realised recently that the server-side and the client-side were a bit different in the way they detect the device. The client-side method has a more solid detection, which I will apply to the server-side method for the next release. But I thought that problem was affecting only devices like the Android tablets… Do you have time to try a little patch? Please contact me directly via the about page (http://totorotimes.wpengine.com/about/).

  • kilgoretrout

    hello

  • Nick Rutter

    Bonjour Jourdy! Alors, j’utilise ton plugin et c’est fantastique! mais, il y a un petit problem.. Les images auxquels j’ai fait ‘crop’ en WP ne ressemble la même après le plugin.. En concernant les thumbnails en particulière. Est-ce qu’il y a un façon de garder le meme crop pour les image @2 ? Merci à vous pour ton taff avec cet plugin alors! Et je suis désolé pour mon français pénible!

    Si vous regardez ici,
    http://nickrutter.co.uk/archives/projects/headshots-2

    les premières deux image (de l’homme en costume et la chemise noire) ne sont pas d’un bon cadre (avec lesquels j’ai utilisé le plugin pour créer des thumbnails) mais les images suivantes sont d’un résolution de merde, MAIS le cadre est bon.. J’éspere que vous pouvez m’aider peut être!

  • dread

    Hello,
    this plugin is great!
    I cant get the server side version running but thats okay.
    I have a question regarding the images. If I upload a aditional @2x image for content in the uploads folder it works. But is ther a way to use this plugin for template images and images I have to place directly in to the themes or third party plugin code in or tags?

    regards

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hello Dread,
      The images generation is automatic for all images that are uploaded to the Media Library, but if it’s outside the WordPress scope, it will not do anything. Of course I could make wild guess and generate them but it would end-up in a big mess and even more depending on the users and their configuration.

  • http://perioandimplants.wordpress.com/ Alessandro Geminiani

    Great plug-in… I hope they implent something on the wordpress.com side also.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Do they have a selection of plugins on WordPress? Maybe there is a way I can apply for this plugin to be added to WordPress.com!

  • DobaKung

    Thanks to this amazing plugin!

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Thanks a lot Don’t forget to rate it if you have some time, it will help

  • http://sebastiencouture.com/ Sebastien Couture

    Hi, I wanted to know what support your plugin has for calling attachments in the template. For instance, I am using Attachments Pro to load images on a page which I wish to call in the template with wp_get_attachment_image($id, &size). I’ve forced retina mode but the function does not load the retina images.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Salut Sébastien! All the images that can be found in the Media Library are supported and more importantly generated for Retina. Can you enable the plugin on your website + debug mode and let me know the URL? I will check a few things. Thanks

      • http://sebastiencouture.com/ Sebastien Couture

        Hi, thanks for the reply. Actually, I had misunderstood how the plugin worked. I thought it hooked into WordPress and served the @x2 images directly. I realize now it works at the htaccess level and serves up the hi-res images under the same filename.

        Very goo sir.

        PS: Just wanted to add that the plugin works very well with Attachments Pro as well as Simple image Sizes.

        • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

          No problem The server-side method works indeed at the .htaccess level, using the same filenames. Though if you are using the client-side method, the filenames will be different and it will not use the .htaccess. But if the server-side method works for you, it is all good, it will be faster for your Retina users Please rate the plugin on WordPress if you like it :p Thanks a lot Sébastien !

  • meadeiator

    Jordy,

    This is a great app. It works very well with Client Side and WP Multisite. I’m interested in testing and providing feedback on running Server Side and WP Multisite w/ subdomains. Do you have any suggestions or suggested resources for the .htaccess file setup? I’m more than happy to share any experiences/feedback that would be useful to you. Thanks in advance for you reply.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hello meadeitaor! Sorry about the time delay in my reply. Actually I think it should work already for a WP multisite… but with subdomains I never tried. It doesn’t work? Did you try? The line added in the .htaccess (by the server method) should actually be good enough.

      • meadeiator

        Jordy, Sorry I reposted a similar post with more detail earlier today. I somehow missed even finding this first post and missed your reply. Apologies, again. With subdomains, it does not work on any image that is uploaded via the WP Media handler. For images that I have as part of my theme where I manually created a @2x image it loads the correct image when appropriate. I’m guessing that it has something to do with how WP is doing its own redirect to handle those images, but not exactly sure. Again, it works fine on the primary domain, just not the subdomain. Thanks again and sorry for the duplicate repost.

  • http://www.danielemargutti.com Daniele Margutti

    Hi, I’ve found this amazing plugin just today A big thank you Jordy.
    However probability I don’t understand something here. When I make software for iOS devices (that’s my work) I have two kind of images: image.png (original/real size) and image@2x.png (double size for retina display).
    Now you say I need to upload an original size image in my WordPress’s Media Library… and I don’t understand why. I would to upload @2x and get scaled 50% image. I’ve tried to upload @2x but my image is bigger on standard device, I’ve also tried to upload standard def image and I get a blurry image on iOS/Retina display. I really don’t know how to use it Where I’m wrong?
    I’ve also tried to upload in a folder both @2x and standard images and link the second as logo for my website header…. however it takes only the standard image size while the doubled is ignored on retina display.
    Thank you again.

    • http://www.danielemargutti.com Daniele Margutti

      it seems to work if I choose “Medium” while uploading @2x image instead of “full size” (Media Importer)

      • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

        Hello Daniele! Yes, never use full size, it’s written in big letters in the FAQ and on this article as well Also you really have to understand how WordPress works, you are not really supposed to use the full size anywhere (it’s just the original image, used to generate all the other ones). Is the rest is fine now actually?

        • http://www.danielemargutti.com Daniele Margutti

          It works fine but as you said in your FAQ slider image still renders in low-res.

          • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

            You should probably work on that issue with the developer of the plugin you are using for your slides. He is the only one that can properly help you. Like I said before (or somewhere), I will try to keep a list of the sliders plugin that works well with Retina displays.

  • tyler

    Hi,

    I’m a little confused on how this plugin works.

    I’m trying to put an image on my site that is 980×346. I uploaded to my site an image that is double that (1960×692).

    1. First, it doesn’t even give me an option with the present sizes (thumb, med, large, fullsize) to choose 980×346. They are instead set at different dimensions – thumb: 150×150, med: 300×105, large: 640×225, fullsize: 1960×346

    2. Even when I select the 640×225, in my Media Library it says that my image is too small and needs to be: (<2048×722)

    What size image am I supposed to upload to use a 980×346 on my site?

    Thanks!

  • izubeldia

    awesome!! you are a crack!!

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Thanks Izubeldia! Is it working well? Share your website with us

  • Pingback: Retina : GuoJing's Blog | 只要心还跳

  • meadeiator

    First, this plugin is terrific. Whether working with images uploaded through WP or creating my own @2x images for custom themes, it is working beautifully. Thank you!
    The one area I could use some guidance is on the setup for using Server and the .htaccess file. I am running a multisite network w/ subdomains where my primary site is http://www.sample.com and my sub-site is http://my.sample.com.
    All works well on the primary site (www.sample.com), however, on the sub-site the images are not displaying (there is the standard no-image placeholder).
    Following are the entries I have to my .htaccess file (inlcuding the the WP entries).

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ – [L]
    RewriteRule .(?:jpe?g|gif|png|bmp)$ wp-content/plugins/wp-retina-2x/wr2x_retinaimages.php [L]
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule . index.php [L]

    Any suggestions are greatly appreciated. I am very interested in making the server-side work and am willing to test suggestions and provide feedback.Quick additional note. On images that I have included in my theme folder, those get handled perfectly on both the main site and the sub-site.It’s only on images that are getting handled via WP upload and have the /files/… prefix. I suspect I have done something to conflict with the WP Rewrite rules however I’m not informed enough to know what I’ve done wrong.
    Thank you in advance for your consideration.

    • meadeiator

      I’ve still been trying to make this work, but am having issues. Here is what I have tested and learned in the interim and hope it provides insight for possible suggestion.

      First, on my main site, http://www.domain.com, WP Retina 2x works without issue. If I’m using a retina display and I have retina images it loads them when available. If I’m using a non-retina display, it pulls the normal resolution version.

      For my subdomain, sub.domain.com, I have the following results. For any images that are part of my theme where I have created a @2x image myself and they are located in the theme folder, all works well, whether viewing on a retina or non-retina display and produces the expected results. However, for any images that are uploaded through the WP Media New function, the images do not display at all in the browser. I have checked the img src for the images and they are pointing to the correct location, typically within the /files directory located in my blogs.dir folders. So, it looks like it is returning the correct image address but I get the no image icon. When testing in Firefox and I put in the address to the actual image, I get the message “The image “XYZ” cannot be display because it contains errors.” If I keep the same address in the browser for the image and comment (#) out the .htaccess line for WP Retina 2X and reload, it pulls the normal image.

      Hopefully this will spark an idea. Thanks again.

      • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

        I replied to you on the WordPress forum. Let’s have our exchanges there

  • Tobi

    Hi jordy i’ve just installed your Plugin – configuered it – and ist Works Perfect! That saves a Lot of Time!

    Thanks men!
    You’ll soon recieve a little donation for your great work!

    Cheers,Tobi

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hello Tobi! Thanks I received it already! I was so surprised! It is the second one for this plugin and I am so glad! It shows how much you appreciate my work and it is an amazing feeling of accomplishment and really keeps me motivated. Thanks a lot, really

  • Theo

    Great plugin…

    When i use the Server-side methode the ‘slides’ on home page dos not appear. Client-side dos work well.
    And how to deal with FancyBox? (portfolio pictures) it forces big images just to fit the browser.

    Thanks…

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Unfortunately, it is to the ‘slide’ plugins developers to resolve this kind of issue. It might be by adding a few more lines of JavaScript or CSS but it has to be done. On the “pure” Retina side, I can’t do anything unfortunately. On the plugin FAQ I wrote that I will keep a list of the ‘slide’ plugin that work well, but as for now, I didn’t get any feedbacks on the ones which are working… only on the ones which are not working Maybe you can help by contacting the developer of FancyBox?

      • Theo

        For the ‘Slide’ image I just uploaded a twice as big image (So it alway shows that image, but it works

        Thanks.

  • Adam

    Really great plugin! When in server-mode my image shows twice as big and is blurred. When I switch to client-mode the image is crisp on retina.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Thanks The problem is in your HTML and CSS. Please check it thoroughly

      • Jeff

        Jordy — you’re plugin is really great. But I’m having the same problem as Adam above. When using the client-side, it works fine (but I do notice that the non-retina image loads, and quickly gets replaced with the retina image). When using server-side, the retina image is served, but at twice the size (not increasing density, just size). I think what Adam may be not mentioning is that this behavior is only happening on theme files (in my specific case, the theme logo).Is there additional code I need to add to HTML / CSS to get the theme logo to work? Thanks for the help. I’ll give a great rating if I can get the server side to work!

  • Dozz

    It’s very useful. Thanks! Jordy.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Thanks a lot for using it Dozz

  • wildea

    Hi, first of all… I love this plugin… The only thing I didn’t get to work is the server-side method. When I activate it, I only see question marks at my media library.

    Thanks
    Alex

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hello Wildea! Client-side works, right? Please install the new version of the plugin (0.4) then if there is an issue, please post here:
      http://wordpress.org/support/plugin/wp-retina-2x. And please provide more details about your install

  • Finneas

    Hello ! Thank you for this great plugin. I can confirm that it works with the Nivo Slider WordPress Plugin ! Now my slides are neat and beautiful on my brand new beloved MacBook

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Thanks a lot!

  • Finneas

    I must add that Nivo works on a server-side mode, not client-side.

    • Finneas

      After a while, it stops working and other images in the page have disappeared. Caching issue, I guess.

      • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

        Does it work now? Caching is still a big issue for Retina, and now Apple is rolling out weird versions of Safari… well, I believe everything with stabilize soon, meanwhile I will keep the plugin very updated.

  • http://twitter.com/jloft Jason Loftis

    Under the advanced settings, the choices are “server side” and “client side.” I want to understand how these correlate with the 3 options you opened the tutorial describing. I presume that “client side” is the “javascript method.” But is “server side” the “hybrid” or the “server” method?

    My primary concern is whether the “server side” method the plugin executes is compatible with caching and/or a CDN.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      The Server-Side is the Server-Method. I didn’t include the Hybrid method on the plugin, as almost nobody would use it I believe (you wouldn’t be able to use caching at all). The Server-Side wouldn’t work well with CDN or with strong-caching… if you use a CDN, only the Client-Method can be used.

  • Jon

    Hi Jordy,
    Great plugin, works great with my static images (using client side, cannot get server to work), however can’t seem to get it to work with any of my sliders (flex and nivo), it shows the first slide on refresh and then they all disappear from then on. Does this work with the sliders and is there anything I can do?
    Cheers

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      I heard it was working with the Nivo Slider though. I think there are threads running about Retina on their forums, maybe we should check? It is actually not directly related to the plugin, and changes should be made elsewhere. If there is anything I can do, please tell me and I’ll react

  • Laurens

    Hi,

    The plugin works perfectly expect for one thing. The logo. I am using a elegant theme (flexible), and i just cant get my logo retina. It just makes it twice as big. On my normal pc screen it seems to work, but if i open the website on my ipad or iphone it doesnt.

    Does anyone have any tips?

    Thank you very much

    Laurens

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      It seems to be a basic issue to me Make sure you have the size (the normal size) of your logo set-up in the HTML code (or alternatively, in the CSS), that’s all, otherwise it will appears twice as big, indeed! It’s also a proof that’s a plugin is working well Don’t forget to read the FAQ of the plugin, this is all explained, as well as in the present article.

  • http://www.facebook.com/Bigfishtools Alton Forthe

    I’m getting an error for my large retina image which is 2200×1542, has to be something in my settings I’m sure.
    Happy New Year

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Happy New Year to you too If you can come over the WordPress forums about this plugin we can talk about it.

  • http://www.modsuperstar.ca/ modsuperstar

    Does this work with items that aren’t in the WordPress media area? Like for templates? I have my images in the template folder and I’m finding this isn’t working. I have both the original and the @2x version there, but the plugin isn’t detecting that there is a retina version.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      It works only with the registered media. For everything else, you have to do it manually and to name the files correctly. If you did it (using the “@2x” in the name), it should work perfectly.

  • sven

    Hello Jordy,

    first of all thanks for your effort in developing this fantastic plugin. Being rather unfamiliar with WP and CSS, I’m trying to set up a site (www.goodbadbetter.com) and I followed all your steps for installation correctly. Unfortunately I can’t get my logo displayed high resolved. In the library all signs next to the uploaded images are green (ok), but on server-side they are displayed pixelated. Only when I switch to client-side the images in the library preview are crisp, but not on the actual website (they don’t appear at all!) Caching apparently isn’t the problem. I’m afraid it’s in the script of the WP template I bought. Any ideas how I can fix it? Thanks!

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Hello Sven! Yes, it’s probably an issue linked to the theme you are using. Client-method would probably work better for you, but in this case I am not sure why the other images wouldn’t appear…

  • http://www.chriscolotti.us/ Chris Colotti

    Jordy should I see the @2 images in firebug so I know they are working or will that still show the original image names? Just trying to know how I am sure they are working.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      Depends which methods you are using. Client-method: yes and no (you should see them coming-in, but not in the code), Server-method: no, HTML Rewrite: yes. Best way of testing it is checking the original sizes of the images you have on the screen.

  • http://www.facebook.com/RyanSmithPersonal Ryan Smith

    It seems to serve the full size retina images to small devices like phones. Would there be a way to disable serving the retina images if a device is small enough, the responsive design of my site is just scaling down the already larger images, they don’t also need the 2x version sent to them. I looked into plugins like Hammy that serve different resolutions depending on the width of the device, it would be great if somehow that could be combined with your plugin. Any ideas? Thanks.

    • http://totorotimes.wpengine.com/ Jordy Meow • Totoro Times

      I already replied to you somewhere else, but I will do it again here The reply is yes, definitely, but probably not depending on the width of the device, only depending on its type (device name).

  • Jeronimo

    Hi there, first of all: thanks for the WP plugin!

    I have one question though, it seems I’m too stupid to get my head around this… do I understand this correctly that the plugin automatically generates the @2x version of my uploaded image? So it basically “upscales” the image, resulting in a loss of quality? Like, when I upload a 300×200 pixel image, it blows it up to 600×400 for the retina versions? This can’t be right. Wouldn’t it make much more sense if I create a beautifully crisp 600×400 image in the first place, upload it, and the plugin automatically *downscales* it to 300×200 for the non-retina version?

    I feel I’m missing something here… thanks for any help you can give me on this subject.

    • http://www.totorotimes.com/ Jordy Meow • Totoro Times

      Yeah, it seems you didn’t get the basics It doesn’t upscale the images, of course not, it would be a disaster, and wouldn’t improve anything. You actually upload the biggest image you can (let’s say that), and WP and WP Retina 2x automatically create the normal images and the retina images, which you will use (you don’t use the big one you originally upload, but depending on the future of your website, maybe you will change the sizes you use on your blog and you can regenerate everything without having to re-upload anything). That’s it

      • Jeronimo

        Thanks for getting back so quickly! Yeah, I can see now what got me confused: I started with the images on my website that don’t conform to the image sizes defined within WP, for example my site logo. I need to upload and insert it in its original size, as the theme requires it to be 240×110 px and that size only works if I use “full size” – which I know you very clearly stated not to use. I tried to upload a retina version at 480×220 px manually and added the @2x, but stil only the low-res version gets pushed, even on an iPad 3.

        Do you happen to have a “quick fix” for this, or any other idea how I could make this work?

        Thanks a million!

        • http://www.totorotimes.com/ Jordy Meow • Totoro Times

          Logos are a special case, you should actually create a retina version by yourself and upload it. I think I wrote this in the FAQ of the plugin. That’s the fix