Timthumb: Could not find the internal image you specified

I am having the following issue with this version of Timthum: 2.8.10 (running on WordPress installation – server Ubuntu):

– When i call images from the server hosting the website i got this error:

Read More

A TimThumb error has occured
The following error(s) occured:

Could not find the internal image you specified.

Query String : src=http://my-host.it/wp-content/files_mf/1346848579prog_no_pic.png
TimThumb version : 2.8.10

If i copy/paste http://my-host.it/wp-content/files_mf/1346848579prog_no_pic.png in the browser i can get the image…

– When i call image from external sites it works fine.
I have enabled:

define ('ALLOW_ALL_EXTERNAL_SITES', TRUE);

at line 33.

Related posts

Leave a Reply

5 comments

  1. For me, the document root wasn’t being set correctly, due to my virtual host setup.

    I had to add the correct one in timthumb-config.php

    define('LOCAL_FILE_BASE_DIRECTORY', "/home/www/mysite/");
    
  2. I had the same problem on a Multisite installation of WordPress (3.5.1). The following fixed it:

    In functions.php change

    function get_image_url($img_src="") {
    if($img_src!="") $theImageSrc = $img_src;
    else $theImageSrc = wp_get_attachment_url(get_post_thumbnail_id($post_id));
    global $blog_id;
    if (isset($blog_id) && $blog_id > 0) {
        $imageParts = explode('/files/', $theImageSrc);
        if (isset($imageParts[1])) {
            $theImageSrc = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
        }
    }
    echo $theImageSrc;
    

    }

    to

    function get_image_url($img_src="") {
    if($img_src!="") $theImageSrc = $img_src;
    else $theImageSrc = strstr(wp_get_attachment_url(get_post_thumbnail_id($post_id)), "/wp-content");
    global $blog_id;
    if (isset($blog_id) && $blog_id > 0) {
        $imageParts = explode('/files/', $theImageSrc);
        if (isset($imageParts[1])) {
            $theImageSrc = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
        }
    }
    echo $theImageSrc;
    

    }

    Note: The only actual modification happens in the 3rd line (bold):
    $theImageSrc = strstr( wp_get_attachment_url(get_post_thumbnail_id($post_id)) , “/wp-content”);

  3. First let me know are you using WordPress Multisite? If yes then you dont need edit anything in timthumb.php me do like it

    This is what I have done to get timthumb to work with multisite. You need to add this code to your theme’s functions.php file

    <?php function get_image_path($src) {
    global $blog_id;
    if(isset($blog_id) && $blog_id > 0) {
    $imageParts = explode('/files/' , $src);
    if(isset($imageParts[1])) {
    $src = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1];
    }
    }
    return $src;
    }
    ?>
    

    And then where the timthumb script is used in the theme, you need to modify to this:

    <img src="<?php bloginfo('template_url'); ?>/includes/timthumb.php?q=100&w=180&h=200&zc=1&a=t&src=<?php echo get_image_path(get_post_meta($post->ID, 'postImage', true)); ?>" alt="" />
    

    where postImage is the name of the meta field the holds the image URL.

    have a nice.