My favorites | Sign in
Project Logo
             
Details: Show all Hide all

Today

  • 7 hours ago
    HowTo Wiki page commented on by subzane   -   How to make it work for images hosted by Flickr for example: ===Find on Line 52=== {{{ $lastModified = filemtime($src); }}} ===Replace With=== {{{ $lastModified = filemtime_remote($src); }}} ===Find on Line 91=== {{{ if(strlen($src) && file_exists($src)) { }}} ===Replace With=== {{{ if(strlen($src)) { }}} ===Find on Line 552=== {{{ function cleanSource($src) { }}} Just have it return the input without any change. ===Add this function=== {{{ function filemtime_remote($uri) { $uri = parse_url($uri); $handle = @fsockopen($uri['host'],80); if(!$handle) return 0; fputs($handle,"GET $uri[path] HTTP/1.1\r\nHost: $uri[host]\r\n\r\n"); $result = 0; while(!feof($handle)) { $line = fgets($handle,1024); if(!trim($line)) break; $col = strpos($line,':'); if($col !== false) { $header = trim(substr($line,0,$col)); $value = trim(substr($line,$col+1)); if(strtolower($header) == 'last-modified') { $result = strtotime($value); break; } } } fclose($handle); return $result; } }}} These changes made it work for me so that I now can fetch images from flickr and resize and cache them.
    How to make it work for images hosted by Flickr for example: ===Find on Line 52=== {{{ $lastModified = filemtime($src); }}} ===Replace With=== {{{ $lastModified = filemtime_remote($src); }}} ===Find on Line 91=== {{{ if(strlen($src) && file_exists($src)) { }}} ===Replace With=== {{{ if(strlen($src)) { }}} ===Find on Line 552=== {{{ function cleanSource($src) { }}} Just have it return the input without any change. ===Add this function=== {{{ function filemtime_remote($uri) { $uri = parse_url($uri); $handle = @fsockopen($uri['host'],80); if(!$handle) return 0; fputs($handle,"GET $uri[path] HTTP/1.1\r\nHost: $uri[host]\r\n\r\n"); $result = 0; while(!feof($handle)) { $line = fgets($handle,1024); if(!trim($line)) break; $col = strpos($line,':'); if($col !== false) { $header = trim(substr($line,0,$col)); $value = trim(substr($line,$col+1)); if(strtolower($header) == 'last-modified') { $result = strtotime($value); break; } } } fclose($handle); return $result; } }}} These changes made it work for me so that I now can fetch images from flickr and resize and cache them.
  • 8 hours ago
    issue 38 (Timthumb not wok in Google Chrome?!) commented on by zito.rosie   -   Same here. Working fine in FF and Safari (on a Mac; don't have IE). Chrome shows up some thumbnails and not others. No reason I can see why some work and others do not. Please fix.
    Same here. Working fine in FF and Safari (on a Mac; don't have IE). Chrome shows up some thumbnails and not others. No reason I can see why some work and others do not. Please fix.

Last 30 days

  • Dec 09, 2009
    issue 45 (Not using Cached files?) commented on by tserafim   -   I was having similar problems with the version that shipped with a wootheme's theme. I updated it to the last version and the problem seems to be gone. Now the files are cached as png rather than gif and I saw a huge improvement on resources usage (by running 'top').
    I was having similar problems with the version that shipped with a wootheme's theme. I updated it to the last version and the problem seems to be gone. Now the files are cached as png rather than gif and I saw a huge improvement on resources usage (by running 'top').
  • Dec 07, 2009
    issue 49 (Cross-site Script Vulnerability - can inject javascript into...) commented on by jimgoings   -   I was able to fix this issue by adding one line to the clean function: $src = htmlentities($src); Can someone please look at this and check it in? :)
    I was able to fix this issue by adding one line to the clean function: $src = htmlentities($src); Can someone please look at this and check it in? :)
  • Dec 07, 2009
    issue 19 (Compatible with WPMU) commented on by ryanchan404   -   quick & dirty fix: // add the following 2 lines at the beginning of timthumb.php define( 'SHORTINIT', true ); require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ); // add the following line "just" before the function call to get_document_root(), e.g. $src = str_replace( array( $_SERVER['DOCUMENT_ROOT'], "/files/") , array("", "") , BLOGUPLOADDIR ) . $src; // Add this line $src = get_document_root($src) . '/' . $src;
    quick & dirty fix: // add the following 2 lines at the beginning of timthumb.php define( 'SHORTINIT', true ); require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ); // add the following line "just" before the function call to get_document_root(), e.g. $src = str_replace( array( $_SERVER['DOCUMENT_ROOT'], "/files/") , array("", "") , BLOGUPLOADDIR ) . $src; // Add this line $src = get_document_root($src) . '/' . $src;
  • Dec 07, 2009
    issue 51 (re-connect back to the page over port 80 not allowed by host...) commented on by weetpr   -   We have resolved the issue now. Thanks
    We have resolved the issue now. Thanks
  • Dec 07, 2009
    issue 51 (re-connect back to the page over port 80 not allowed by host...) reported by weetpr   -   The thumbnail generator does not work. The company managing our hosting gave us this response. "http://web118.extendcp.co.uk/hhc-lewis.co.uk/wp-content/themes/rt-theme5/timthumb.php?src=http://web118.extendcp.co.uk/h hc-lewis.co.uk/wp-content/uploads/2009/11/epm-150x150.jpg&w=150&h=109&zc=1 This link is attempting to re-connect back to the page over port 80 in order to display the image. This is not possible for security reasons. You can see the second part of the link is not giving a path to the file on the server but a loopback, as though it was an external link at a remote site. Because of this reason http://web118.extendcp.co.uk/hhc-lewis.co.uk/wp-content/uploads/2009/11/502102_b-150x150.jpg will work & http://web118.extendcp.co.uk/hhc-lewis.co.uk/wp-content/themes/rt-theme5/timthumb.php?src=http://web118.extendcp.co.uk/h hc-lewis.co.uk/wp-content/uploads/2009/11/502102_b-150x150.jpg will not. This script would have to be recoded to deal with absolute paths local to the server instead." Can this be done? This posted by somebody who is not technical with absolutely no experience of PHP. Thanks
    The thumbnail generator does not work. The company managing our hosting gave us this response. "http://web118.extendcp.co.uk/hhc-lewis.co.uk/wp-content/themes/rt-theme5/timthumb.php?src=http://web118.extendcp.co.uk/h hc-lewis.co.uk/wp-content/uploads/2009/11/epm-150x150.jpg&w=150&h=109&zc=1 This link is attempting to re-connect back to the page over port 80 in order to display the image. This is not possible for security reasons. You can see the second part of the link is not giving a path to the file on the server but a loopback, as though it was an external link at a remote site. Because of this reason http://web118.extendcp.co.uk/hhc-lewis.co.uk/wp-content/uploads/2009/11/502102_b-150x150.jpg will work & http://web118.extendcp.co.uk/hhc-lewis.co.uk/wp-content/themes/rt-theme5/timthumb.php?src=http://web118.extendcp.co.uk/h hc-lewis.co.uk/wp-content/uploads/2009/11/502102_b-150x150.jpg will not. This script would have to be recoded to deal with absolute paths local to the server instead." Can this be done? This posted by somebody who is not technical with absolutely no experience of PHP. Thanks
  • Dec 06, 2009
    issue 50 (Allowed memory size error) reported by eskis.martynas   -   Somehow I get error on using resizer. What I try to create other photos everyting seems to be ok, but on few photos this shows: "Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 15004 bytes) in /home/domain.com/lt/public_html/core/resizer.php on line 293" Tried to clean catche, but no success, Please advice.
    Somehow I get error on using resizer. What I try to create other photos everyting seems to be ok, but on few photos this shows: "Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 15004 bytes) in /home/domain.com/lt/public_html/core/resizer.php on line 293" Tried to clean catche, but no success, Please advice.
  • Dec 02, 2009
    issue 49 (Cross-site Script Vulnerability - can inject javascript into...) reported by jimgoings   -   What steps will reproduce the problem? 1. Insert a javascrpt in the URI and the browser will execute it. See sample script below. http://www.somewebsite.com/wp-content/themes/mytheme/scripts/timthumb.php?src=http%3A%2F%2Fwww.somewebsite.com%2Ffiles%2F2009%2F11%2FSomeImage.gif%22%3E%3Cscript%3Ealert%28123%29%3C%2Fscript%3E&amp=&zc=1&w=120&h=90%22 What is the expected output? What do you see instead? It should do string validation to prevent scripts form executing. Removing "<" and ">" would likely do the trick. What version of the product are you using? On what operating system? Latest version as far as I know. Please provide any additional information below.
    What steps will reproduce the problem? 1. Insert a javascrpt in the URI and the browser will execute it. See sample script below. http://www.somewebsite.com/wp-content/themes/mytheme/scripts/timthumb.php?src=http%3A%2F%2Fwww.somewebsite.com%2Ffiles%2F2009%2F11%2FSomeImage.gif%22%3E%3Cscript%3Ealert%28123%29%3C%2Fscript%3E&amp=&zc=1&w=120&h=90%22 What is the expected output? What do you see instead? It should do string validation to prevent scripts form executing. Removing "<" and ">" would likely do the trick. What version of the product are you using? On what operating system? Latest version as far as I know. Please provide any additional information below.
  • Dec 01, 2009
    issue 39 (External Link Usage !!) commented on by clay.mcilrath   -   I may have a fix for you, but first let me describe what this will/won't work on: Your script will not work cross-domain (meaning you can't link to an image that is on a different server than the script). However, if you're trying to do something like this: http://yoursite.com/timthumb.php?src=http://www.yoursite.com/image.png Then apply this: // sort out image source $src = get_request("src", ""); // remove the http://....com and replace with a relative "/" to root directory $src = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*?)?)?)@', '/', $src);
    I may have a fix for you, but first let me describe what this will/won't work on: Your script will not work cross-domain (meaning you can't link to an image that is on a different server than the script). However, if you're trying to do something like this: http://yoursite.com/timthumb.php?src=http://www.yoursite.com/image.png Then apply this: // sort out image source $src = get_request("src", ""); // remove the http://....com and replace with a relative "/" to root directory $src = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*?)?)?)@', '/', $src);
  • Dec 01, 2009
    issue 48 (Turn Absolute paths into relative paths) reported by clay.mcilrath   -   What steps will reproduce the problem? If you link to an image with an absolute path http://website.com/timthumb.php?src=http://www.website.com/image.png note the www triggers an error in many browsers as it's treated as an external source. I recommend some sort of preg_replace to ignore url and use ONLY relative paths. Cross-domain linking doesn't work anyways, so why not have the script ignore this and process as a relative link: (this could obviously be simplified and improved, but this works and you get the point: // sort out image source $src = get_request("src", ""); $src = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*?)?)?)@', '/', $src);
    What steps will reproduce the problem? If you link to an image with an absolute path http://website.com/timthumb.php?src=http://www.website.com/image.png note the www triggers an error in many browsers as it's treated as an external source. I recommend some sort of preg_replace to ignore url and use ONLY relative paths. Cross-domain linking doesn't work anyways, so why not have the script ignore this and process as a relative link: (this could obviously be simplified and improved, but this works and you get the point: // sort out image source $src = get_request("src", ""); $src = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*?)?)?)@', '/', $src);
  • Dec 01, 2009
    issue 38 (Timthumb not wok in Google Chrome?!) commented on by Pepto.Svensson   -   Clearing the image cache did not help for me. Images are created in cache, but does not appear on web page. Before clearing cache, some 10% of the images was shown, but i could not see any difference between those who worked and those who did not. All is fine in firefox, IE8 and Opera, both before and after clearing cache. I did not see this error before moving to new host with php5 (was php4), now using apache 1.3.37 and php 5.2.3 on a linux machine. Any ideas?
    Clearing the image cache did not help for me. Images are created in cache, but does not appear on web page. Before clearing cache, some 10% of the images was shown, but i could not see any difference between those who worked and those who did not. All is fine in firefox, IE8 and Opera, both before and after clearing cache. I did not see this error before moving to new host with php5 (was php4), now using apache 1.3.37 and php 5.2.3 on a linux machine. Any ideas?
  • Nov 28, 2009
    issue 15 (Problem to execute file command) commented on by oliversteinmetz1   -   I still have this problem.. any fixes? Will try your solution, images work me for but that error message is annoying and filled my error_log will 1GB of junk
    I still have this problem.. any fixes? Will try your solution, images work me for but that error message is annoying and filled my error_log will 1GB of junk
  • Nov 23, 2009
    HowTo Wiki page commented on by keithbglover   -   In phpThumbs its loike this... $PHPTHUMB_CONFIG['error_message_image_default'] = ''; // Set this to the name of a generic error image (e.g. '/images/error.png') that you want displayed in place of any error message that may occur. This setting is overridden by the 'err' parameter, which does the same thing.
    In phpThumbs its loike this... $PHPTHUMB_CONFIG['error_message_image_default'] = ''; // Set this to the name of a generic error image (e.g. '/images/error.png') that you want displayed in place of any error message that may occur. This setting is overridden by the 'err' parameter, which does the same thing.
  • Nov 23, 2009
    HowTo Wiki page commented on by keithbglover   -   Hi, is there a way to set a default image if the image src is not found? Thx for the great script!
    Hi, is there a way to set a default image if the image src is not found? Thx for the great script!
  • Nov 18, 2009
    issue 11 (new parameter, zcoy: zoom_crop_offset_y) commented on by josue.salazar   -   Thanks for this. Both the fix to quality plus the cropping offset have been of great help.
    Thanks for this. Both the fix to quality plus the cropping offset have been of great help.
  • Nov 18, 2009
    issue 47 (Error into my Theme) reported by moohpwet   -   What steps will reproduce the problem? 1. Already installed 2. I tried to change something into timthumb.php but i'm noob! What is the expected output? What do you see instead? I installed a theme on Wordpress with this plugin already in, but as you can see, in the header, i can't see the picture, only at the bottom. The link for the pict is correct. What version of the product are you using? On what operating system? Wordpress 2.8.6 on Linux Please provide any additional information below. You can see it @ http://beta.monespacepersonnel.net
    What steps will reproduce the problem? 1. Already installed 2. I tried to change something into timthumb.php but i'm noob! What is the expected output? What do you see instead? I installed a theme on Wordpress with this plugin already in, but as you can see, in the header, i can't see the picture, only at the bottom. The link for the pict is correct. What version of the product are you using? On what operating system? Wordpress 2.8.6 on Linux Please provide any additional information below. You can see it @ http://beta.monespacepersonnel.net
  • Nov 17, 2009
    issue 46 (red x's still show up) reported by than.saliem   -   What steps will reproduce the problem? 1. clear browser cache 2. request a page with an image that has been resized with timthumb 3. image shows up as a red x on ie 4. reload page 5. image shows up fine What is the expected output? What do you see instead? resized image, red box What version of the product are you using? On what operating system? 1.09, linux, ie8.06 Please provide any additional information below. I saw that this was an issue and tried using the latest source code. But the issue is still there
    What steps will reproduce the problem? 1. clear browser cache 2. request a page with an image that has been resized with timthumb 3. image shows up as a red x on ie 4. reload page 5. image shows up fine What is the expected output? What do you see instead? resized image, red box What version of the product are you using? On what operating system? 1.09, linux, ie8.06 Please provide any additional information below. I saw that this was an issue and tried using the latest source code. But the issue is still there

Earlier this year

  • Nov 17, 2009
    issue 45 (Not using Cached files?) reported by niallerb   -   What steps will reproduce the problem? 1. Host has told me that the site I run will be disabled if I cannot fix timthumb. Apparently it's hogging big resources on the shared server I'm operating from. Host says problem is that the images are being created on the fly each time and are not cached. 2. However cached files are created so I think it might be to do with a full(as in 250 files) cache that won't flush itself. What is the expected output? What do you see instead? How can I check that timthumb is using the cached versions? Any ideas or help? What version of the product are you using? On what operating system? Linux, 1.09, Wordpress. Please provide any additional information below.
    What steps will reproduce the problem? 1. Host has told me that the site I run will be disabled if I cannot fix timthumb. Apparently it's hogging big resources on the shared server I'm operating from. Host says problem is that the images are being created on the fly each time and are not cached. 2. However cached files are created so I think it might be to do with a full(as in 250 files) cache that won't flush itself. What is the expected output? What do you see instead? How can I check that timthumb is using the cached versions? Any ideas or help? What version of the product are you using? On what operating system? Linux, 1.09, Wordpress. Please provide any additional information below.
  • Nov 10, 2009
    issue 44 (Problem where finfo php extension is misconfigured on the se...) reported by pieter.berkel   -   I came across an unusual error condition where the following error message was output: Warning: finfo_open() [function.finfo-open]: Failed to load magic database at '/etc/magic'. in /htdocs/public/www/wp- content/themes/starmagazine/scripts/timthumb.php on line 373 And as a result the image resize operation failed (headers already output). I'm guessing this occurs where the finfo php extension is not configured or installed correctly on the server, I fixed the code by adding some simple error checking for finfo_open(), please see following diff code: 373,375c373,376 < $finfo = finfo_open(FILEINFO_MIME); < $mime_type = finfo_file($finfo, $file); < finfo_close($finfo); --- > if ($finfo = @finfo_open(FILEINFO_MIME)) { > $mime_type = finfo_file($finfo, $file); > finfo_close($finfo); > } Would appreciate if you could include this patch in your svn trunk code. Thanks!
    I came across an unusual error condition where the following error message was output: Warning: finfo_open() [function.finfo-open]: Failed to load magic database at '/etc/magic'. in /htdocs/public/www/wp- content/themes/starmagazine/scripts/timthumb.php on line 373 And as a result the image resize operation failed (headers already output). I'm guessing this occurs where the finfo php extension is not configured or installed correctly on the server, I fixed the code by adding some simple error checking for finfo_open(), please see following diff code: 373,375c373,376 < $finfo = finfo_open(FILEINFO_MIME); < $mime_type = finfo_file($finfo, $file); < finfo_close($finfo); --- > if ($finfo = @finfo_open(FILEINFO_MIME)) { > $mime_type = finfo_file($finfo, $file); > finfo_close($finfo); > } Would appreciate if you could include this patch in your svn trunk code. Thanks!
  • Nov 09, 2009
    issue 28 (20kb JPG file converts to a 200kb PNG file - increase in fil...) commented on by p...@aipro.co.uk   -   Hi I have a smilar problem that the timthumb code above doesn't seem to make any difference :( my files are not changing into pngs or very large jpegs, however as soon as I ad just two images (either cropped to exact size or large) my page takes about 4-6 seconds to load anything, thne the whole page appears all at once. If I take the images out it appears instantly like all the other pages. Can anyone help? many thanks in advance. demo site here http://www.mepphotography.co.uk the problem is on the homepage.
    Hi I have a smilar problem that the timthumb code above doesn't seem to make any difference :( my files are not changing into pngs or very large jpegs, however as soon as I ad just two images (either cropped to exact size or large) my page takes about 4-6 seconds to load anything, thne the whole page appears all at once. If I take the images out it appears instantly like all the other pages. Can anyone help? many thanks in advance. demo site here http://www.mepphotography.co.uk the problem is on the homepage.
  • Nov 04, 2009
    issue 43 (Constants not properly decleared.) reported by jorgen.ivarsson   -   What steps will reproduce the problem? 1. if php.ini contains the following line: error_reporting = E_ALL 2. And code in timtumb contains: $imageFilters = array( "1" => array(IMG_FILTER_NEGATE, 0), "2" => array(IMG_FILTER_GRAYSCALE, 0), "3" => array(IMG_FILTER_BRIGHTNESS, 1), "4" => array(IMG_FILTER_CONTRAST, 1), "5" => array(IMG_FILTER_COLORIZE, 4), "6" => array(IMG_FILTER_EDGEDETECT, 0), "7" => array(IMG_FILTER_EMBOSS, 0), "8" => array(IMG_FILTER_GAUSSIAN_BLUR, 0), "9" => array(IMG_FILTER_SELECTIVE_BLUR, 0), "10" => array(IMG_FILTER_MEAN_REMOVAL, 0), "11" => array(IMG_FILTER_SMOOTH, 0), ); 3. What is the expected output? What do you see instead? Error message: otice: Use of undefined constant IMG_FILTER_NEGATE - assumed 'IMG_FILTER_NEGATE' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 30 Notice: Use of undefined constant IMG_FILTER_GRAYSCALE - assumed 'IMG_FILTER_GRAYSCALE' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 31 Notice: Use of undefined constant IMG_FILTER_BRIGHTNESS - assumed 'IMG_FILTER_BRIGHTNESS' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 32 Notice: Use of undefined constant IMG_FILTER_CONTRAST - assumed 'IMG_FILTER_CONTRAST' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 33 Notice: Use of undefined constant IMG_FILTER_COLORIZE - assumed 'IMG_FILTER_COLORIZE' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 34 And so on... What version of the product are you using? On what operating system? Timthumb version 1.09 Please provide any additional information below. Please note that constant name must always be quoted when defined. e.g. define('MY_CONST','blah') - correct define(MY_CONST,'blah') - incorrect The error message above also indicates this fact. If this code is used instead in the script: $imageFilters = array( "1" => array('IMG_FILTER_NEGATE', 0), "2" => array('IMG_FILTER_GRAYSCALE', 0), "3" => array('IMG_FILTER_BRIGHTNESS', 1), "4" => array('IMG_FILTER_CONTRAST', 1), "5" => array('IMG_FILTER_COLORIZE', 4), "6" => array('IMG_FILTER_EDGEDETECT', 0), "7" => array('IMG_FILTER_EMBOSS', 0), "8" => array('IMG_FILTER_GAUSSIAN_BLUR', 0), "9" => array('IMG_FILTER_SELECTIVE_BLUR', 0), "10" => array('IMG_FILTER_MEAN_REMOVAL', 0), "11" => array('IMG_FILTER_SMOOTH', 0), ); everything works fine. Please update your script.
    What steps will reproduce the problem? 1. if php.ini contains the following line: error_reporting = E_ALL 2. And code in timtumb contains: $imageFilters = array( "1" => array(IMG_FILTER_NEGATE, 0), "2" => array(IMG_FILTER_GRAYSCALE, 0), "3" => array(IMG_FILTER_BRIGHTNESS, 1), "4" => array(IMG_FILTER_CONTRAST, 1), "5" => array(IMG_FILTER_COLORIZE, 4), "6" => array(IMG_FILTER_EDGEDETECT, 0), "7" => array(IMG_FILTER_EMBOSS, 0), "8" => array(IMG_FILTER_GAUSSIAN_BLUR, 0), "9" => array(IMG_FILTER_SELECTIVE_BLUR, 0), "10" => array(IMG_FILTER_MEAN_REMOVAL, 0), "11" => array(IMG_FILTER_SMOOTH, 0), ); 3. What is the expected output? What do you see instead? Error message: otice: Use of undefined constant IMG_FILTER_NEGATE - assumed 'IMG_FILTER_NEGATE' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 30 Notice: Use of undefined constant IMG_FILTER_GRAYSCALE - assumed 'IMG_FILTER_GRAYSCALE' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 31 Notice: Use of undefined constant IMG_FILTER_BRIGHTNESS - assumed 'IMG_FILTER_BRIGHTNESS' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 32 Notice: Use of undefined constant IMG_FILTER_CONTRAST - assumed 'IMG_FILTER_CONTRAST' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 33 Notice: Use of undefined constant IMG_FILTER_COLORIZE - assumed 'IMG_FILTER_COLORIZE' in /home/domains/www.imm-award.de/htdocs/wp-content/themes/constructor/timthumb.php on line 34 And so on... What version of the product are you using? On what operating system? Timthumb version 1.09 Please provide any additional information below. Please note that constant name must always be quoted when defined. e.g. define('MY_CONST','blah') - correct define(MY_CONST,'blah') - incorrect The error message above also indicates this fact. If this code is used instead in the script: $imageFilters = array( "1" => array('IMG_FILTER_NEGATE', 0), "2" => array('IMG_FILTER_GRAYSCALE', 0), "3" => array('IMG_FILTER_BRIGHTNESS', 1), "4" => array('IMG_FILTER_CONTRAST', 1), "5" => array('IMG_FILTER_COLORIZE', 4), "6" => array('IMG_FILTER_EDGEDETECT', 0), "7" => array('IMG_FILTER_EMBOSS', 0), "8" => array('IMG_FILTER_GAUSSIAN_BLUR', 0), "9" => array('IMG_FILTER_SELECTIVE_BLUR', 0), "10" => array('IMG_FILTER_MEAN_REMOVAL', 0), "11" => array('IMG_FILTER_SMOOTH', 0), ); everything works fine. Please update your script.
  • Oct 20, 2009
    HowTo Wiki page commented on by ke...@kevinkashou.com   -   How can I convert the png thumbnail to jpg?
    How can I convert the png thumbnail to jpg?
  • Oct 18, 2009
    issue 34 (won't work the first time) commented on by superwillyfoc   -   #1 you can fix this issue defining more exectuion time for the script. You can add this line to the script PHP file, for example after the other "init_set" line: ini_set("max_execution_time", "300"); #Max execution time = 30 seconds
    #1 you can fix this issue defining more exectuion time for the script. You can add this line to the script PHP file, for example after the other "init_set" line: ini_set("max_execution_time", "300"); #Max execution time = 30 seconds
  • Oct 13, 2009
    issue 19 (Compatible with WPMU) commented on by ndrwld   -   This solution doesn't work for me.. :( I added lines on the top of my timthumb.php: require '../../../wp-blog-header.php'; // conversion functions in wp-includes/wpmu-functions.php And here is my function cleanSource($src): function cleanSource($src) { // remove slash from start of string if(strpos($src, "/") == 0) { $src = substr($src, -(strlen($src) - 1)); } // remove http/ https/ ftp $src = preg_replace("/^((ht|f)tp(s|):\/\/)/i", "", $src); // remove domain name from the source url $host = $_SERVER["HTTP_HOST"]; $src = str_replace($host, "", $src); $host = str_replace("www.", "", $host); $src = str_replace($host, "", $src); // don't allow users the ability to use '../' // in order to gain access to files below document root // src should be specified relative to document root like: // src=images/img.jpg or src=/images/img.jpg // not like: // src=../images/img.jpg $src = preg_replace("/\.\.+\//", "", $src); $blog_name = preg_replace('/^.*\/(\w+)\/files.*$/', '${1}', $src); $src = preg_replace('/^.*\/(\w+)\/files/', '/wp-content/blogs.dir/'.get_id_from_blogname($blog_name).'/files', $src); // get path to image on file system $src = get_document_root($src) . '/' . $src; return $src; }
    This solution doesn't work for me.. :( I added lines on the top of my timthumb.php: require '../../../wp-blog-header.php'; // conversion functions in wp-includes/wpmu-functions.php And here is my function cleanSource($src): function cleanSource($src) { // remove slash from start of string if(strpos($src, "/") == 0) { $src = substr($src, -(strlen($src) - 1)); } // remove http/ https/ ftp $src = preg_replace("/^((ht|f)tp(s|):\/\/)/i", "", $src); // remove domain name from the source url $host = $_SERVER["HTTP_HOST"]; $src = str_replace($host, "", $src); $host = str_replace("www.", "", $host); $src = str_replace($host, "", $src); // don't allow users the ability to use '../' // in order to gain access to files below document root // src should be specified relative to document root like: // src=images/img.jpg or src=/images/img.jpg // not like: // src=../images/img.jpg $src = preg_replace("/\.\.+\//", "", $src); $blog_name = preg_replace('/^.*\/(\w+)\/files.*$/', '${1}', $src); $src = preg_replace('/^.*\/(\w+)\/files/', '/wp-content/blogs.dir/'.get_id_from_blogname($blog_name).'/files', $src); // get path to image on file system $src = get_document_root($src) . '/' . $src; return $src; }
  • Oct 12, 2009
    issue 19 (Compatible with WPMU) commented on by reallycat   -   /* CAT - Oct 2009 The problem I identified is this: TimThumb.php expects a real URL the file in $src, but WPMU creates virtual URL paths to resources. So $src gets: "http://site.dom/wpmu/blog-name/files/2009/10/03032008.jpg" instead of a URL with the real file system path: "http://site.dom/wp-content/blogs.dir/2/files/2009/10/03032008.jpg" (where blog named 'blog-name' is number '2'). My solution is to modify the variable $src containing the URL, in function cleanSource(). This will work for all the blogs on this WPMU install. */ require '../../../wp-blog-header.php'; // conversion functions in wp-includes/wpmu-functions.php ////////in function clearSource() after those 2 lines of code: $src = preg_replace("/\.\.+\//", "", $src); //print_r($_SERVER); // WPMU fix - CAT (2 new lines) $blog_name = preg_replace('/^.*\/(\w+)\/files.*$/', '${1}', $src); //this extracts the blog name from the URL (done separately since can't use backreferences in function args in replacement string below!! :( ) $src = preg_replace('/^.*\/(\w+)\/files/', '/wp-content/blogs.dir/'.get_id_from_blogname($blog_name).'/files', $src); // this modifies the URL from virtual to real path, using an existing WPMU function That's it. Now all the virtual paths created in WPMU are automatically transformed in a real one pointing to the actual image file.
    /* CAT - Oct 2009 The problem I identified is this: TimThumb.php expects a real URL the file in $src, but WPMU creates virtual URL paths to resources. So $src gets: "http://site.dom/wpmu/blog-name/files/2009/10/03032008.jpg" instead of a URL with the real file system path: "http://site.dom/wp-content/blogs.dir/2/files/2009/10/03032008.jpg" (where blog named 'blog-name' is number '2'). My solution is to modify the variable $src containing the URL, in function cleanSource(). This will work for all the blogs on this WPMU install. */ require '../../../wp-blog-header.php'; // conversion functions in wp-includes/wpmu-functions.php ////////in function clearSource() after those 2 lines of code: $src = preg_replace("/\.\.+\//", "", $src); //print_r($_SERVER); // WPMU fix - CAT (2 new lines) $blog_name = preg_replace('/^.*\/(\w+)\/files.*$/', '${1}', $src); //this extracts the blog name from the URL (done separately since can't use backreferences in function args in replacement string below!! :( ) $src = preg_replace('/^.*\/(\w+)\/files/', '/wp-content/blogs.dir/'.get_id_from_blogname($blog_name).'/files', $src); // this modifies the URL from virtual to real path, using an existing WPMU function That's it. Now all the virtual paths created in WPMU are automatically transformed in a real one pointing to the actual image file.
  • Oct 07, 2009
    issue 42 (Script fails with php 5.3) reported by chris.de.kok   -   What steps will reproduce the problem? 1. Install wampserver 2. Run the script... What is the expected output? What do you see instead? An images... What version of the product are you using? On what operating system? XP phph 5.3 Please provide any additional information below. It sends only the url back... Ithink because it uses some deprecated functions like eregi..
    What steps will reproduce the problem? 1. Install wampserver 2. Run the script... What is the expected output? What do you see instead? An images... What version of the product are you using? On what operating system? XP phph 5.3 Please provide any additional information below. It sends only the url back... Ithink because it uses some deprecated functions like eregi..
  • Oct 06, 2009
    issue 26 (Its not working for my gif images) commented on by jpiccato   -   Hi, I had the same error using timthumb version included in pivotx (www.pivotx.net) In my case the code $image = imagecreatefromgif( $src ); in "function open_image" was failing with all my pivotx uploaded gif files. I think the cause was located somewhere in the upload process where the image was internally transformed to Jpg but the filename is left unchanged... another option could be that my source files were fake gif images (for example jpeg files with gif extension). Keep in mind that browsers don't rely to filename extension, and show the image flawlessy, but you can see the type of the showed image looking at page properties... so I suggest to double check your server uploaded image to see if they are proper gif or not. HTH
    Hi, I had the same error using timthumb version included in pivotx (www.pivotx.net) In my case the code $image = imagecreatefromgif( $src ); in "function open_image" was failing with all my pivotx uploaded gif files. I think the cause was located somewhere in the upload process where the image was internally transformed to Jpg but the filename is left unchanged... another option could be that my source files were fake gif images (for example jpeg files with gif extension). Keep in mind that browsers don't rely to filename extension, and show the image flawlessy, but you can see the type of the showed image looking at page properties... so I suggest to double check your server uploaded image to see if they are proper gif or not. HTH
  • Oct 06, 2009
    issue 26 (Its not working for my gif images) commented on by jpiccato   -   Hi, I can provide a URL showing the same error. I cannot understand why the code $image = imagecreatefromgif( $src ); in "function open_image" is failing... Thank you for your support.
    Hi, I can provide a URL showing the same error. I cannot understand why the code $image = imagecreatefromgif( $src ); in "function open_image" is failing... Thank you for your support.
  • Oct 02, 2009
    issue 37 (Header modification error.) commented on by n...@nekkidtees.com   -   I have the same problems and it causes the error file to get rather large at times.
    I have the same problems and it causes the error file to get rather large at times.
  • Sep 26, 2009
    issue 38 (Timthumb not wok in Google Chrome?!) commented on by doggie52   -   Apparently this is fixed by clearing the cache.
    Apparently this is fixed by clearing the cache.
  • Sep 26, 2009
    issue 38 (Timthumb not wok in Google Chrome?!) commented on by doggie52   -   I also have this problem. Some images work however, and I've tried to find a pattern but failed. Please, could you resolve this? I am using the Thesis Wordpress theme, which uses Timthumb.
    I also have this problem. Some images work however, and I've tried to find a pattern but failed. Please, could you resolve this? I am using the Thesis Wordpress theme, which uses Timthumb.
  • Sep 23, 2009
    issue 28 (20kb JPG file converts to a 200kb PNG file - increase in fil...) commented on by masroor.gilani   -   @Christoph. Thanks for your version. I felt sudden swiftness in my site. @gmorenog. Thanks, now testing your mod of Chritstoph, but feels sluggish at the moment
    @Christoph. Thanks for your version. I felt sudden swiftness in my site. @gmorenog. Thanks, now testing your mod of Chritstoph, but feels sluggish at the moment
  • Sep 20, 2009
    issue 8 (HostGator (Apache 2) mod_security rule) commented on by brianenelson   -   If you have only one or two websites, or don't work with any clients, chatting with HostGator is all fine and dandy. But, if you have a lot of sites (not just all on the same shared hosting account) or if you work with clients who choose the hosting and how it gets configured, that isn't really a solution that is workable. Does anyone know what exactly in the mod_sec rules is being violated? It seems odd that a plug-in like this would trigger any of these kind of rules. I'm betting it is one step that is just a tad too clever and if we could tweak it, then this whole issue could go away for everyone (theme developers, site owners, consultants, etc...) Or, if we are 100% sure that this all works as intended, then we could start asking HostGator to make the modifications necessary by default on all installs of WordPress.
    If you have only one or two websites, or don't work with any clients, chatting with HostGator is all fine and dandy. But, if you have a lot of sites (not just all on the same shared hosting account) or if you work with clients who choose the hosting and how it gets configured, that isn't really a solution that is workable. Does anyone know what exactly in the mod_sec rules is being violated? It seems odd that a plug-in like this would trigger any of these kind of rules. I'm betting it is one step that is just a tad too clever and if we could tweak it, then this whole issue could go away for everyone (theme developers, site owners, consultants, etc...) Or, if we are 100% sure that this all works as intended, then we could start asking HostGator to make the modifications necessary by default on all installs of WordPress.
  • Sep 16, 2009
    issue 33 (Wordpress JPG upload not visible publicly via IE, but ok in ...) commented on by vbarsoteli   -   I believe the problem is in function show_cache_file, inside the IF "if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]))".
    I believe the problem is in function show_cache_file, inside the IF "if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]))".
  • Sep 16, 2009
    issue 33 (Wordpress JPG upload not visible publicly via IE, but ok in ...) commented on by vbarsoteli   -   by the way, I am using JPG.
    by the way, I am using JPG.
  • Sep 16, 2009
    issue 33 (Wordpress JPG upload not visible publicly via IE, but ok in ...) commented on by vbarsoteli   -   Only works on IE when I clean cache witch CTRL+F5, why? In FF works ok. What can I do about this error.
    Only works on IE when I clean cache witch CTRL+F5, why? In FF works ok. What can I do about this error.
  • Sep 14, 2009
    issue 41 (problem with large images) reported by florinachis   -   The problem is, when it tries to resize a big image something like 3000 x it doesn`t work. It shows a blank page
    The problem is, when it tries to resize a big image something like 3000 x it doesn`t work. It shows a blank page
  • Sep 10, 2009
    issue 40 (how do i whitelist domain in mod_security? *not with hostgat...) reported by galen.toh   -   anyone know how to get it work if i am not with hostgator? but i am running centOS with cpanel/whm and apache here. what must i put into the mod_security configuration? thanks in advance!
    anyone know how to get it work if i am not with hostgator? but i am running centOS with cpanel/whm and apache here. what must i put into the mod_security configuration? thanks in advance!
  • Sep 10, 2009
    issue 8 (HostGator (Apache 2) mod_security rule) commented on by galen.toh   -   anyone know how to get it work if i am not with hostgator? but i am running centOS with cpanel/whm and apache here. what must i put into the mod_security configuration? thanks in advance!
    anyone know how to get it work if i am not with hostgator? but i am running centOS with cpanel/whm and apache here. what must i put into the mod_security configuration? thanks in advance!
  • Sep 08, 2009
    issue 19 (Compatible with WPMU) commented on by joseffb78   -   Here is a modified version of the code that I thought would work but it just isn't working for me, it may work for you it ads in the blog id for you. <?php //Check if custom field key "Image" has a value global $blog_id; $values = get_post_custom_values("preview"); if (isset($values[0])) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=wp-content/blogs.dir/<?php echo $blog_id; ?>/<?php $values = get_post_custom_values("preview"); echo $values[0]; ?>&amp;w=360&amp;h=180&amp;zc=1&amp;q=100" alt="<?php the_title(); ?>" class="right" width="360px" height="180px" /></a> <?php } ?>
    Here is a modified version of the code that I thought would work but it just isn't working for me, it may work for you it ads in the blog id for you. <?php //Check if custom field key "Image" has a value global $blog_id; $values = get_post_custom_values("preview"); if (isset($values[0])) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=wp-content/blogs.dir/<?php echo $blog_id; ?>/<?php $values = get_post_custom_values("preview"); echo $values[0]; ?>&amp;w=360&amp;h=180&amp;zc=1&amp;q=100" alt="<?php the_title(); ?>" class="right" width="360px" height="180px" /></a> <?php } ?>
  • Sep 06, 2009
    issue 28 (20kb JPG file converts to a 200kb PNG file - increase in fil...) commented on by gmorenoq   -   Attached is a modified version of christoph.boecken's file. Now the quality setting works.
    Attached is a modified version of christoph.boecken's file. Now the quality setting works.
  • Sep 03, 2009
    issue 39 (External Link Usage !!) reported by ismaeel.abuamsha   -   What steps will reproduce the problem? 1. using wordpress. and copy entire posts with the original images links. 2. when my theme use timthumb.php to generate resized copies. 3. it stops because we have "http" external links. What is the expected output? What do you see instead? i want to check $src -the link- and redirecting it to external links resizer function else use the local.
    What steps will reproduce the problem? 1. using wordpress. and copy entire posts with the original images links. 2. when my theme use timthumb.php to generate resized copies. 3. it stops because we have "http" external links. What is the expected output? What do you see instead? i want to check $src -the link- and redirecting it to external links resizer function else use the local.
  • Sep 01, 2009
    HowTo Wiki page commented on by damien.carbery   -   @warriorwomenblog: You currently need to store all the images on your own server.
    @warriorwomenblog: You currently need to store all the images on your own server.
  • Aug 31, 2009
    issue 8 (HostGator (Apache 2) mod_security rule) commented on by ad...@disabledboatflag.com   -   HOST GATOR WILL GET IT WORKING REFER THEM TO THIS PAGE AND HAVE THEM LOOK AT COMMENT 16
    HOST GATOR WILL GET IT WORKING REFER THEM TO THIS PAGE AND HAVE THEM LOOK AT COMMENT 16
  • Aug 26, 2009
    HowTo Wiki page commented on by warriorwomenblog   -   Hi is it possible to get this to work for images that I host on flickr and insert into my blog, or do I need to store all the images on my own server?
    Hi is it possible to get this to work for images that I host on flickr and insert into my blog, or do I need to store all the images on my own server?
  • Aug 24, 2009
    issue 28 (20kb JPG file converts to a 200kb PNG file - increase in fil...) commented on by Dhruwal   -   please help to get this fixed. my 5 kb gif gets converted to 60kb png.
    please help to get this fixed. my 5 kb gif gets converted to 60kb png.
  • Aug 23, 2009
    issue 8 (HostGator (Apache 2) mod_security rule) commented on by boongzogzag   -   I also had the same problem, the image resizer function (timthumb.php) of the theme I used with wordpress didn't work. Even I set the cache folder in Hostgator to have permission to read and write already. After I read the comment of this site (http://premiumthemes.net/theme-support/tips-n-tutorials/image-not-showing-up-troubleshooting-image-resizer-thumbphp.html) and do what it say. I did Live Chat with Hostgator, they took around 30 minutes to resolve the problem, finally it works. See how it works go to http://www.buythischeapnow.com
    I also had the same problem, the image resizer function (timthumb.php) of the theme I used with wordpress didn't work. Even I set the cache folder in Hostgator to have permission to read and write already. After I read the comment of this site (http://premiumthemes.net/theme-support/tips-n-tutorials/image-not-showing-up-troubleshooting-image-resizer-thumbphp.html) and do what it say. I did Live Chat with Hostgator, they took around 30 minutes to resolve the problem, finally it works. See how it works go to http://www.buythischeapnow.com
  • Aug 22, 2009
    HowTo Wiki page commented on by studioxlcom   -   dballcaus, see my comment above, that answers your question
    dballcaus, see my comment above, that answers your question
  • Aug 22, 2009
    issue 36 (500 Internal Server Error) commented on by TalentedMrWeb   -   I think this is due to the install not being in the main directory. I had a similar install and results, I moved the wordpress files into the default web directory (keep in mind you have to change your setting in WP first otherwise you'll have to alter it in the database). This solved my issue.
    I think this is due to the install not being in the main directory. I had a similar install and results, I moved the wordpress files into the default web directory (keep in mind you have to change your setting in WP first otherwise you'll have to alter it in the database). This solved my issue.
 
Hosted by Google Code