Forum Moderators: coopster
Here's the basics of what the script does when a black and white thumbnail is called for.
1 - Checks to see if the bw thumbnail already exists in cache
2 - If it doesn't exist ImageMagick is called to convert the color thumbnail to grayscale and save it to cache
3 - File is opened from cache into fread()
4 - Header sent image/jpeg followed by the data from fread.
This works flawlessly on the two Linux servers (Apache 1.3 PHP4 / Apache 2 PHP4) I've tried it on, but on a WinXP server running Apache 2 / PHP5 the browser just sits and waits for images that never come. I let it run overnight last night just to see if it was working, but really slowly. Nothing.
After it does this I have to restart Apache to get the site working again.
$fhandle = fopen($filename, "rb");
$dataout = fread($fhandle, filesize($filename));
fclose($fhandle);
What are the options? I'm fairly certain I need filesize() to tell fread how much to read. Is there a way to tell fread to read everything without using filesize()?