<?php
// Make thumbs if they are needed
$imagelist = GetFileList($imagepath);
foreach ($imagelist as $image)
{
// Setup vars
$realimage = $imagepath."/".$image;
$thumbimage = $thumbpath."/".$image;
// Compare thumb files to $image
if ( ! file_exists($thumbimage))
{
// Create thumbnail
set_time_limit(0);
$thumb_exists = ResizeImage($realimage, $thumbpath."/".$image, $thumbwidth);
if ($thumb_exists)
{
PrintStatus("Created thumbnail for $image");
}
if (! $thumb_exists)
{
PrintError("Could not create thumbnail for $image");
}
}
}
?><br><br>
<p>All image processing has finished! Please view the <a href="/" class="link" target="_top">photo album</a>.</p>
<?php
function PrintError($error)
{
?>
<font color="red"><?php echo $error ?></font><br>
<?php
}
function PrintStatus($status)
{
?>
<font color="green"><?php echo $status ?></font><br>
<?php
}
Okay, so the above code works just fine. I'm dynamically making thumbnails for a photo album script, and it works just fine - except for the fact that it doesn't output the status messages until AFTER all of the thumbnails are completed, which can take quite a long time. I was wondering if it was possible to change anything in my code to make each status/error message print to the browser right after the thumbnail (ResizeImage()) operation was complete. Anyone?