Beispiel #1
0
 public function fixPhoto($filename,$filenamepre,$filenamethb) {
  $image = new SimpleImage();                                // instantiate image manipulation class
  $image->load($filenamepre);                                // load source image
  if (($image->getWidth()>$this->settings->previewwidth) || ($image->getHeight()>$this->settings->previewheight)) {
   $image->load($filename);                                  // load source image
   $image->resizepic(
    $this->settings->previewwidth, 
    $this->settings->previewheight
   );                                                        // resize to height as desired in technical requirements
   $image->save($filenamepre);                               // save resized file to disk
  }
  $image->load($filenamethb);                                // load source image
  if (($image->getWidth()>$this->settings->thumbwidth) || ($image->getHeight()>$this->settings->thumbheight)) {
   $image->load($filename);                                  // load source image
   $image->resizepic(
    $this->settings->thumbwidth, 
    $this->settings->thumbheight
   );                                                        // resize to height as desired in technical requirements
   $image->save($filenamethb);                               // save resized file to disk
  }
 }