Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter kalleboo

    (@kalleboo)

    Awesome ??

    • This reply was modified 8 years, 1 month ago by kalleboo.
    Thread Starter kalleboo

    (@kalleboo)

    Sorry for the delayed reply, apparently my email notifications from wp.org aren’t working.

    It took me a while to realize that “Regenerate Thumbnails” was a separate plugin and not a built-in feature.

    Running that on the image that wasn’t working did solve the problem. Thanks! I guess consider this solved.

    For the future I guess it would be useful if you could integrate whatever it is doing to regenerate the metadata into the wp-retina-2x “Generate” button.

    I had this problem and solved it by patching these lines in wp-retina-2x.php to make it reuse the original host name as modified by the S3 plugin instead of rewriting it to a local URL. I haven’t tested this with other setups and it may break things for you if your settings aren’t the same as mine (I don’t know why the original code looked the way it did)

    In wr2x_picture_rewrite, starting on line 143:

    $img_urlinfo = parse_url($node->getAttribute( "src" ));  //kalleboo
    $hostinfo = $img_urlinfo['scheme'].'://'.$img_urlinfo['host'].'/';  //kalleboo
    $img_pathinfo = wr2x_get_pathinfo_from_image_src( $node->getAttribute( "src" ) );
    $filepath = trailingslashit( ABSPATH ) . $img_pathinfo;
    $potential_retina = wr2x_get_retina( $filepath );
    
    if ( $potential_retina != null ) {
    	$retina_pathinfo = ltrim( str_replace( ABSPATH, "", $potential_retina ), '/' );
    	$retina_url = trailingslashit( $hostinfo ) . $retina_pathinfo;  //kalleboo
    	$img_url = trailingslashit( $hostinfo ) . $img_pathinfo;  //kalleboo
    	$from = $doc->saveXML($node);

    P.S. there’s another gotcha with the S3 plugin: If you turn on filename versioning in S3 settings then it breaks the retina plugin since it can’t find the versioned directories that exist on S3 locally. Might want to put that one in the troubleshooting docs.

    Thread Starter kalleboo

    (@kalleboo)

    Sorry I didn’t update this post.

    This was filed before picturefill was added. Picturefill solves this problem beautifully.

    Thanks for an essential plugin!

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