syamilmj / Aqua-Resizer

Resize WordPress images on the fly
502 stars 208 forks source link

Not working Heroku #18

Open lperichon opened 11 years ago

lperichon commented 11 years ago

Hi!!! Im using a Wordpress theme that uses Aqua-Resizer. Everything works on development, but not on Heroku where Im hosting my staging and production environment. Since Heroku has a read-only filesystem (except for temporary files) I use a plugin to upload to S3 and uploads work ok. Maybe this could be causing the problem... I confirmed the problem is here since using the unprocessed url for the image works fine.

lvxn0va commented 11 years ago

I'm having the same issue with images pushed to S3 from Wordpress...actually any outside URL that is processed on the fly with Aqua won't work for me. Does it have to do with this?:

//define upload path & dir
    $upload_info = wp_upload_dir();
    $upload_dir = $upload_info['basedir'];
    $upload_url = $upload_info['baseurl'];

    //check if $img_url is local
    if(strpos( $url, $upload_url ) === false) return false;

    //define path of image
    $rel_path = str_replace( $upload_url, '', $url);
    $img_path = $upload_dir . $rel_path;

I wonder if it's possible to define an if/else conditional to include remoteURLs? Or to load the "Link_To" remote path to $url - my php is below beginner but I'll tinker with it..