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 setHttpClient($httpClient)
 {
     self::$httpClient = $httpClient;
 }
<?php

/**
 * @copyright 2006-2011 LanMediaService, Ltd.
 * @license    http://www.lanmediaservice.com/license/1_0.txt
 * @author Ilya Spesivtsev <*****@*****.**>
 * @version $Id: api.php 700 2011-06-10 08:40:53Z macondos $
 */
if (!isset($_GET['p']) || !isset($_GET['v'])) {
    exit;
}
define('SKIP_DEBUG_CONSOLE', true);
require_once dirname(__FILE__) . "/app/config.php";
Lms_Application::setRequest();
Lms_Application::prepareApi();
Lms_Debug::debug('Request URI: ' . $_SERVER['REQUEST_URI']);
$url = Lms_Thumbnail::processDeferUrl($_GET);
if ($url) {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: ' . $url);
    header("Pragma: public");
    header("Cache-Control: public");
    header("Expires: " . date("r", time() + 600));
}
Lms_Application::close();
 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);
 }
 public static function setCache($cache)
 {
     self::$cache = $cache;
 }