WordPress.org

Ready to get started?Download WordPress

Forums

WP Retina 2x
[resolved] Request: Option to tune retina ratio from x2 to x1.5 (20 posts)

  1. synthview
    Member
    Posted 1 year ago #

    Hi,
    thanks for you plugin working perfectly.
    However, I notice on pages with many imgs the loading time becomes huge, without talking about mobile retina phones.

    I think and option setting the standard retina enlargement would be useful. for instance to set 1.5%, images will be crisper than x1, but lighter then x2.

    Also, would it be possible to have an option to do-not use @x2 images on smaller screens ? The case: I have some photos 900px wide. On an iPad I'd need retina versions of them, but on an iPhone, the 900px fits to screen size and get like a retina one. Actually with your plugin an iPhone loads an image 1800px wide to display it on a 480px wide screen. A big waste of CPU and bandwidth.

    Thnaks a lot

    http://wordpress.org/extend/plugins/wp-retina-2x/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    Heyhey,

    Doable easily, yes, I could definitely add the 1.5x option if it helps. I would keep the @2x extension, and later in time, if you want to have real @2x, you would just have to click on "Delete all @2x" and then "Generate all". I added this to my to do list.

    There is actually a fresh thread on this forum asking for the same thing about avoiding the mobiles to get the @2x images :) I will add this as a setting in the next release.

    When you have time, please write a little review (http://wordpress.org/support/view/plugin-reviews/wp-retina-2x)^^ Thanks a lot :)

  3. synthview
    Member
    Posted 1 year ago #

    yes, maybe a slider or something letting adjust between 1.4 and 2 would be fine always keeping "@2x" in file name to keep in consistent (for instance I'm relaying on the scripts of your plugin to serve some template’s images in retina res).

    There is a plugin trying to serve smaller imgs for mobile,
    BJ Lazy Load
    you could maybe take a look at it

  4. synthview
    Member
    Posted 1 year ago #

    Update: it seems your plugin is very memory-demanding. My actual server does not support the workload as Im working on an images blog :(

    I don't know if it's something you can optimize, I leave you the feedback just in case.

  5. synthview
    Member
    Posted 1 year ago #

    this file is listed in the server’s error log
    (12)Cannot allocate memory: […] /wp-content/plugins/wp-retina-2x/wr2x_image.php

    I'm using "server mode"

  6. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    You should use another plugin for the "responsivity" performance of the images. The retina plugin will only be about supporting Retina, and depending on the theme, it could actually register and use smaller images by itself if it was well made (and of course would go through the WordPress system and the WP Retina 2x). The plugins that handle the resizing depending on the devices are somewhat a patch, a workaround, and if I had to develop a theme, I wouldn't need one of those for sure. The less plugins the better :)

    Very demanding, do you think ? :p It's actually extremely light. I understand there is a problem with the Server-Side Method (which is using Retina Images: http://retina-images.complexcompulsions.com/). Normally images are sent to the browsers more or less "directly" but with this method, they go through PHP. You should maybe try to give more memory available to your PHP (by default, the memory limits are usually low on hosting services, but you can change that). Don't you want to try the HTML Rewrite method?

  7. synthview
    Member
    Posted 1 year ago #

    Hello,
    I've tried the html rewrite but I have the same memory limit issue.
    So, are you telling me to try implement Retina images directly into my theme right? The cool stuff of your plugin however is it generated al the imgs automagically :)

    Thanks

  8. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    You have thie memory limit issue with HTML Rewrite as well!? Wow. Okay, I think your WordPress is running at its very limit right now, you really must change your settings. Did you read this plugin's FAQ? There is a solution in it, please try, I am pretty sure it will work.

    You don't have to implement Retina in your theme: you have to implement the "Optimized Responsiveness" in it.

    Basically, the Responsive Theme have 3 (more or less) different screen sizes. Depending on each of those supported screen sizes, the layout changes, and the image sizes change as well (again: this has nothing to do with Retina). For example, let's say your posts originally contain a large image that is 1200*800. On an iPhone, the theme layout would change and the image would became 400*300 (or something else). For that, the themes usually just change the size using CSS. If you want to do it right, you should try to have your theme using 400*300 images directly from the start :) You would also have this 400*300 size registered in WordPress as well.

    Retina has nothing to do with that, of course. It will do this job, and just load a bigger image in case it is a retina, to fill-up the screen pixel-density.

    Is it clear? Maybe not... It is actually a bit difficult to explain, and a very recent issue.

    Actually I think those responsive themes are more an annoyance than anything, and if you really want your website to looks great on PC, Tablets, and Phones, you should have 3 completely different themes adapted for each. Much simpler and optimized.

  9. synthview
    Member
    Posted 1 year ago #

    Ok thanks, I'll read our faq with more attention this afternoon. My issue is I can't change apache settings. I'll maybe change hosting ;)
    As the site I'm building is essentially about photos set as 100% width of an elastic container div, how can I change them on the fly with screen size, and without using javascript (as the photos aren't in background of course so no css switch possible)?

  10. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    You don't need to change those settings, don't worry, the wp-config.php will be enough :)

    Change them on the fly is usually not a good idea, I have a photo blog as well and I don't bother with that (just thinking about making a version of my theme for the phones). I guess just use a CSS with a new size for mobile phones will be alright for now. It will not be optimized but I am not sure you want to do a huge amount of work to have an awesome photos website for iPhone. People interested in it will prefer to look at it on a normal display anyway...

  11. synthview
    Member
    Posted 1 year ago #

    Not sure, retina iPads screen are much better than any Pc/Mac desktop screen today. But I understand about the phones.

  12. synthview
    Member
    Posted 1 year ago #

    Wait! I've set to html rewrite and disabled some other settings from the plugin "lazy load" and now it seems to work better.
    In fact, How the Html rewrite works exactly? does any devices load the images twice?
    Thanks

  13. synthview
    Member
    Posted 1 year ago #

    In fact, with Server mode, my theme's retina images were loaded automatically. Now the images into my css (background images) aren't retina any more.
    Have I to create a special HD css for it (but on retina devices the images will be loaded twice) or to manually insert the js making the switch?

  14. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    HTML Rewrite simply "rewrites" your HTML, replacing directly the normal images by retina images when required (and possible). It is not loaded twice, and there will be no 404.

    CSS and theme should be handled separately in most cases. If it is only the theme, just use double-size image always and don't bother, probably your theme images aren't that heavy anyway. Alternatively, you can use CSS and media queries :)

  15. synthview
    Member
    Posted 1 year ago #

    Ok thanks,
    yep, I've added a retina css media query and kept retina images enabled on thumbnails only, as big images are big enough to iPad and resize gracefully on iPhone becoming retina-like automatically.
    Great plugin anyway :) thanks

  16. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    I'm glad your website is retina, it's all that count :)

  17. synthview
    Member
    Posted 1 year ago #

    :)
    http://weddings.davidbacher.com (the FR version is not completed yet) it's a site I'm doing for a friend

  18. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    That's cool, thanks for sharing :)

  19. synthview
    Member
    Posted 1 year ago #

    Hello,
    looing at my logs I see this

    [10-Apr-2013 16:33:10 UTC] PHP Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag nav invalid in Entity, line: 32 in /[…]/wp-content/plugins/wp-retina-2x/wp-retina-2x.php on line 92
    [10-Apr-2013 16:33:10 UTC] PHP Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag footer invalid in Entity, line: 91 in /[…]/wp-content/plugins/wp-retina-2x/wp-retina-2x.php on line 92
    [10-Apr-2013 19:32:49 UTC] PHP Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Tag nav invalid in Entity, line: 32 in /[…]/wp-content/plugins/wp-retina-2x/wp-retina-2x.php on line 92
    [10-Apr-2013 19:32:49 UTC] PHP Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: no name in Entity, line: 76 in /[…]/wp-content/plugins/wp-retina-2x/wp-retina-2x.php on line 92

    Some issues with html5 tags?

  20. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    Ah yeah, this will be corrected in the next update. There are useless warnings, don't worry much about them.

    You can change the line 92 from...
    $doc->loadHTML( $buffer );
    to
    @$doc->loadHTML( $buffer );

    It will be better :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic