TimThumb is my favorite Auto Generated Thumbnail code ever seen, simple to use and work great in almost server. But there are readfile function problem on some server in TimThumb auto resized imaged on the fly, this script development by Darren Hoyt and Tweak by Ben Gillbanks, The problem that I currently have is readfile function that disabled by Hosting Server Administrator, they said disabled this function for security reason. So I googling to find out how to fix this problem.
After we googling with several keyword, I got the best solutions from OJAK AJA, and here what we must do. Open your TimThumb script and find this code (around line 496 on version 1.12)
readfile( $cache_file );
Then you need replace readfile function with file_get_contents, Sigiro said, this is the best method, beside file_gets_contents, there are several PHP Functions we can use, such as fpassthru, back to this tricks, to make your TimThumb work, replace code above with this code
$img_data = file_get_contents( $cache_file ); echo $img_data;
And done, this tricks work like charms in my server client. I hope tricks to fix Readfile Problem on TimThumb is worked on you too