• Hey there,

    i am using this great plugin with the picturefill-method for a while now, but still beeing confused why the src-attribute is cleared in wp-retina-2x.php on line 135:
    $element->src = null;

    since i got some troubles with a gallery-script and google started to remove all my images from its index (dont know if that is related in any way…), i changed the lines 134 and 135 according to http://www.webkit.org/demos/srcset/ like this:

    $element->srcset =  "$img_url 1x, $retina_url 2x";
    $element->src = $img_url;

    and it works like a charm!

    now i am not shure if i have missed anything here, is there a reason why there should be no src-attribute in the img-element?

    https://ww.wp.xz.cn/plugins/wp-retina-2x/

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

    (@tigroumeow)

    Hello Ben,

    That is a good question and I was afraid of the same thing. I am not sure about that but I have the feeling that Google is actually reading this srcset since it should be supported by most browser very soon (without the PictureFill script). Another question for you since I didn’t try: if you use “src”, isn’t srcset ignored? Your website works well on Retina, even with this change? If yes, I might think of re-adding “src”…

    Thread Starter benjholl

    (@benjholl)

    Hello Jordy,

    on my pc with chrome 39.0.2171.95m on zoom “100%”, the src-attribute is ignored and the 1x srcset image is loaded. as soon as i refresh the page on zoom “200%”, the 2x image is loaded.

    on my pc with ie11, the whole srcset-attribute is ignored and the src image is loaded, even without picturefill-script.
    (for example on this page: http://garnienicht.de/reise/2013-ziele-sind-voellig-ueberbewertet/page/6/)

    i also have tested this with iOS8.1.2, Chrome and Safari are loading the 2x images without the picturefill-script.

    i am really surprised about the justified-gallery-script, which behaves exactly the same way right now, loading 1x or 2x images as it should.
    (for example on this page: http://garnienicht.de/2012/12/03/eigentlich-ist-es-nicht-gruselig-es-sieht-nur-so-aus/)

    i think i will activate the picturefill-script again, just in case… but as far as i can tell right now, my website works well, even with this change.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Picturefill, additional src-attribute in img-element?’ is closed to new replies.