Please Read First
Troubleshooting Tips
Frequently Asked Questions
Before Posting Please Disable Wp Super Cache Plugin
When Posting Please Include Your URL.
Search Forum Using Google Search Box Above
Forum Video

Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default image resizing error in native.php

    Hi,

    I am trying to apply Socrates 3.02 to my existing blog at http://www.cottagesmallholder.com
    That brings its own set of challenges!
    I am using a theme switcher, so the Socrates theme is not yet visible to visitors, only to Admins.

    The home page under my current theme is configured to display the newest post in full, followed by the four most recent post excerpts with thumbnails. This will be reconfigured in Socrates. Right now, Socrates is attempting to display the five most recent posts in full.

    One article is causing problems - the third one from the top. It appears correctly as a single post and in Category lists etc in Socrates. But it breaks the Home page in Socrates for some reason. I did reload the image using WP Media upload function and deleted the original image. But the path below to the image appears valid.

    This is the relevant section of native.php with my simple debug "echo" lines
    95 // no cache files - let's finally resize it
    96 echo "File path $file_path <br />";
    97 echo "Width $width <br />";
    98 echo "Height $height <br />";
    99 echo "Crop $crop <br />";
    100 echo "output ends here <br />";
    101 $new_img_path = image_resize( $file_path, $width, $height, $crop );
    102 $new_img_size = getimagesize( $new_img_path );
    103 $new_img = str_replace( basename( $image_src[0] ), basename( $new_img_path ), $image_src[0] );
    This is the error that appears on the Home page, complete with the debug output:
    Recipe for Fiona’s fabulous watercress soup
    File path /home/cottages/public_html/wp-content/images/recipes/soup/picture_of_watercress_soup_recipe.jpg
    Width 160
    Height 160
    Crop 1
    output ends here

    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/cottages/public_html/wp-content/themes/socrates/functions/native.php on line 102
    strangely, I attempted to echo $new_img_path before line 102 but the error threw before it performed the echo.

    Happy to PM Admin access credentials if that helps.

    Thanks,
    Fiona

  2. #2
    Join Date
    Jun 2010
    Location
    Maine
    Posts
    7,390
    Rep Power
    12

    Default

    I honestly am not sure where to start with this issue.

    Can I assume you've been through all the results in Google for: Catchable fatal error: Object of class WP_Error could not be converted to string in

    There are a lot...

  3. #3
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default

    Correct. There are a lot.

    It could be an incorrectly defined variable type, for example. But it seems likely that I am not the first user to have exercised that chunk of code. Given that the values appear valid as per my debug output I am stumped.

    I am not a PHP coder, just a dabbler.

    OK, I will try contacting the author of that 3rd party code module and point him to this thread.

  4. #4
    Join Date
    Jun 2010
    Location
    Maine
    Posts
    7,390
    Rep Power
    12

    Default

    Have you checked the html tab of the article that is breaking it for any misformatted code.

  5. #5
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default

    Hah!
    I have discovered that the image link does not work for some (but not all) instances of displaying a thumbnail in my existing theme.
    It must have something to do with my attempts to move or re-load the image to a different folder.

    Sorry about that. It simply was not apparent in HTML. I need to ensure I have loaded it correctly in the WP media loader.

    Thanks once again for your prompt response.

Similar Threads

  1. Resizing Issue & Best Way to View on Mobile?
    By glennf in forum Official Support 3.0
    Replies: 1
    Last Post: 01-19-2012, 09:26 AM
  2. Featured Image and Post Image
    By williamavon in forum Official Support 3.0
    Replies: 11
    Last Post: 11-05-2011, 07:55 PM
  3. Resizing post or Nav bar
    By Vickie in forum Official Support 3.0
    Replies: 2
    Last Post: 09-10-2011, 10:42 AM
  4. Google Crawl Error - Redirect Error
    By shawniepea in forum Wordpress Errors
    Replies: 1
    Last Post: 08-21-2011, 12:33 PM
  5. Navigation Bar Resizing-Help!
    By mymochamoney in forum Official Support 3.0
    Replies: 12
    Last Post: 05-13-2011, 11:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •