public static function fromFingerprint($fingerprint) { $array = self::decodeFingerprint($fingerprint); extract($array); $image = new AjdeResourceImage($s); $image->setWidth($w); $image->setHeight($h); $image->setCrop($c); return $image; }
public static function getImageTag($filename, $width = null, $height = null, $crop = true, $class = '', $lazy = false, $absoluteUrl = false) { $image = new AjdeResourceImage($filename); $image->setWidth($width); $image->setHeight($height); $image->setCrop($crop); $controller = Controller::fromRoute(new Route('_core/component:image')); $controller->setImage($image); $controller->setExtraClass($class); $controller->setLazy($lazy); $controller->setAbsoluteUrl($absoluteUrl); return $controller->invoke(); }
public function process() { switch ($this->_attributeParse()) { case 'render': $image = new Image($this->attributes['filename']); $image->setWidth($this->attributes['width']); $image->setHeight($this->attributes['height']); $image->setCrop(String::toBoolean($this->attributes['crop'])); $controller = Controller::fromRoute(new Route('_core/component:imageBase64')); $controller->setImage($image); $controller->setWidth(issetor($this->attributes['width'], null)); $controller->setHeight(issetor($this->attributes['height'], null)); $controller->setExtraClass(issetor($this->attributes['class'], '')); return $controller->invoke(); break; } // TODO: throw new Exception('Missing required attributes for component call'); }