function thumbnail($domImage, $width = 0, $height = 0, $tolerance = 0.0, $zoom = true, $force = false) { $imagePath = $domImage->getSrc(); $thumbnailPath = Lms_Thumbnail::thumbnail($imagePath, $width, $height, $tolerance, $zoom, $force); $domImage->setSrc($thumbnailPath); if ($width) { $domImage->setWidth($width); } if ($height) { $domImage->setHeight($height); } return $domImage; }
public static function thumbnail($imgPath, &$width = 0, &$height = 0, $defer = false) { if (!preg_match('{^https?://}i', $imgPath)) { $imgPath = dirname(APP_ROOT) . '/' . $imgPath; } return Lms_Thumbnail::thumbnail($imgPath, $width, $height, $tolerance = 0.0, $zoom = true, $force = true, $deferDownload = $defer, $deferResize = $defer); }