static function createForFile($fileName, $filePath, $fileType = false) { $layer = new eZImageLayer(); $layer->setStoredFile($fileName, $filePath, $fileType); $layer->process(); return $layer; }
function __construct($imageObjectRef = null, $imageObject = null, $width = false, $height = false, $font = false, $boundingBox = null, $text = null, $textAngle = 0) { parent::__construct($imageObjectRef, $imageObject, $width, $height, $font); $this->Text = $text; $this->TextAngle = $textAngle; $this->TextBoundingBox = $boundingBox; }
function loadImage($dirs, $base, $md5Text, $alternativeText, $imageType) { $name = preg_replace(array("#[^a-zA-Z0-9_-]+#", "#__+#", "#_\$#"), array('_', '_', ''), $alternativeText); $file = "{$name}.{$imageType}"; $splitMD5Path = eZDir::getPathFromFilename($md5Text); $dirPath = eZDir::path(array($dirs, $base, $splitMD5Path, $md5Text)); $filePath = eZDir::path(array($dirPath, $file)); $fileHandler = eZClusterFileHandler::instance($filePath); if (!$fileHandler->exists()) { return null; } // we use a local cache of the file, because the eZImage library only works on files on the file system $fileHandler->fetch(true); return eZImageLayer::createForFile($file, $dirPath, $this->StoreAs); }