title: GD Thumbnail Creation - Is it possible tu run a script by short stages?
body: <p>I'm using this modified script (<a href="http://webcheatsheet.com/php/create_thumbnail_images.php" rel="nofollow">http://webcheatsheet.com/php/create_thumbnail_images.php</a>) for creating thumbnails for all images in one step:</p>
  
  <pre><code>function createThumbs( $pathToImages, $pathToThumbs, $thumbWidth, $imageQuality )
  {
  $dir = opendir( $pathToImages );
  
  while (false !== ($fname = readdir( $dir ))) {
  
  $info = pathinfo($pathToImages . $fname);
  if ( strtolower($info['extension']) == 'jpg' ){
  
  $img = imagecreatefromjpeg( "{$pathToImages}{$fname}" );
  $width = imagesx( $img );
  $height = imagesy( $img );
  
  $new_width = $thumbWidth;
  $new_height = floor( $height * ( $thumbWidth / $width ) );
  
  $tmp_img = imagecreatetruecolor( $new_width, $new_height );
  imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );
  
  imagejpeg( $tmp_img, "{$pathToThumbs}{$fname}",$imageQuality )}}
  closedir( $dir );}
  </code></pre>
  
  <p>I have to create over 250 thumbnails but i cant because of limited execution time.
  If possible I use set_time_limit()</p>
  
  <pre><code>if (function_exists('set_time_limit') == true AND @ini_get('safe_mode') == 0){
  @set_time_limit(9000);
  }
  </code></pre>
  
  <p>But if there is no possibility to modify ini settings - is there a way to let the script convert images in steps like:
  create 10 thumbs > header('Location: ./?function=createThumbs') > create next 10 thumbs .. until all thumbs are created.
  Thank You in advance for any help!</p>