Example #1
0
 public static function resizeAndCrop($file, $format = 'mini', $offset = array('x' => 50, 'y' => 50))
 {
     $image = new ImageGD(self::$formats[$format]);
     $image->createFromFile($file);
     $image->resize();
     $image->crop($offset);
     $image->save();
 }
 public function getImage()
 {
     $ImgArgs = $this->imgView->getArgsFromURL();
     $check = self::$galleryPath . DIRECTORY_SEPARATOR . $ImgArgs['src'];
     if (is_file($check)) {
         $img = $this->contentCatalog->getContentImgByID($ImgArgs['src']);
         $GD = new ImageGD();
         $headerInfo = $GD->getHeaderInfo($ImgArgs, $img);
         $this->imgView->renderHTML($headerInfo['header'], $headerInfo['cacheFileName']);
     }
 }