/** * {@inheritDoc} * * @return mixed */ public function process() { $src = $this->getProperty('src'); if (empty($src)) { return $this->failure(); } $this->unsetProperty('src'); $this->getSource($this->getProperty('source')); if (empty($this->source)) { $this->failure($this->modx->lexicon('source_err_nf')); } $src = $this->source->prepareSrcForThumb($src); if (empty($src)) { return ''; } $this->loadPhpThumb(); /* set source and generate thumbnail */ $this->phpThumb->set($src); /* check to see if there's a cached file of this already */ if ($this->phpThumb->checkForCachedFile()) { $this->phpThumb->loadCache(); return ''; } /* generate thumbnail */ $this->phpThumb->generate(); /* cache the thumbnail and output */ $this->phpThumb->cache(); $this->phpThumb->output(); return ''; }