View Single Post
Old 01-06-2018, 03:14 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,055
USAGE:

Code:
<?php

  require_once('optimize_images_class.php');

  // create class
  $new_page=new sarettahs_image_script\optimize_images;
  
  $new_page->verbose=1; // show messages as the run progresses.  if 0 then clas will not produce run messages
  $new_page->base_dir='/image_folder/';  // folder where original images are.   This folder must exist
  $new_page->optimized_dir='/optimized_folder/';  // folder to put resized images in.  Program will try to create this folder if it is not there
  $new_page->thumb_dir='/thumbs_folder/'; // folder to put thumbs into. Program will try to create this folder if not there.  If left blank then will not create thumbs.
  $new_page->watermark='watermark_image'; // image to use for watermark.  If left blank then no watermark will be used
  $new_page->image_output='gif'; // can be jpg, gif or png

  echo "Start of run " . date("M d Y H:i:s", time()) . "<br>\n";  
  flush();
  
  $new_page->mainline();   // runs the program

  if(!empty($new_page->errmess))
  {
    echo "Errors: " . $new_page->errmess . "<br>\n";     // lists errors
  }
  else
  {
    echo "There were no errors<br>\n";
  }
  
  echo "End of run " . date("M d Y H:i:s", time()) . "<br>\n";

  // show the total counts
  
  echo "Made " . $new_page->tot_files_made . " optimized images<br>\n";
  echo $new_page->tot_files_failed . " optimized images failed<br>\n";
  echo "Made " . $new_page->tot_thumbs_made . " thumb images<br>\n";
  echo $new_page->tot_thumbs_failed . " thumb images failed<br>\n";
?>
Have Fun

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote