WP Smush - Image Optimization
[resolved] [Plugin: WP Smush.it] Error: Could not find: strange path (3 posts)

  1. shortster
    Posted 5 years ago #

    When I create a post in the normal way and upload an image through the new post 'add an image' button everything goes fine. In the media-library I see the image is attached to the post and the image gets smushed.

    However if I upload an image through for example the commentbox (via a plugin) on the frontend of my website, the image gets uploaded to the media-library but the smush.it column says:
    "could not find /home/mysite/domains/mysite.com/public_html/wp-content/uploads/http://www.mysite.com/wp-content/uploads/2011/03/theimage.jpg"

    Note: the image is not attached to a post (unattached). Don't know if that's good or bad..

    Any idea what's wrong here?

  2. shortster
    Posted 5 years ago #

    Found the error. When manually adding an uploaded image to the media library, you use:
    wp_insert_attachment( $attachment, $filepath);
    wp_generate_attachment_metadata( $attach_id, $filepath );
    Where $filepath needs to be the absolute path. I used the url. With the url in the metadata of the image WP Smush.it tried to locate the image at
    absolutepath + url = /home/mysite/domains/mysite.com/public_html/wp-content/uploads/http://www.mysite.com/wp-content/uploads/2011/03/theimage.jpg

    Hope it makes sense :)

  3. José Luís
    Posted 4 years ago #

    It makes sense. But how do we fix it? I'm not using a plugin, only WP Media Library upload function and this error keeps showing.

    Any news on this topic?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Smush - Image Optimization
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic