Exemple #1
0
/**
 * Returns an image identifier representing the image obtained from the given filename, using only GD, returns an empty string on failure
 *
 * @param string $fileName
 * @return image identifier
 */

function imagecreatefrompsd($fileName) {
	$psdReader = new PhpPsdReader($fileName);
	if (isset($psdReader->infoArray['error'])) return '';
	else return $psdReader->getImage();
}
 private function imagecreatefrompsd($fileName)
 {
     if (file_exists($this->psdReaderPath)) {
         include_once $this->psdReaderPath;
         $psdReader = new PhpPsdReader($fileName);
         if (isset($psdReader->infoArray['error'])) {
             return '';
         } else {
             return $psdReader->getImage();
         }
     } else {
         return false;
     }
 }
Exemple #3
0
 private function imagecreatefrompsd($fileName)
 {
     # Author:     Tim de Koning
     # Version:    1.3
     # Purpose:    To create an image from a PSD file.
     # Param in:   PSD file to open.
     # Param out:  Return a resource like the other ImageCreateFrom functions
     # Reference:  http://www.kingsquare.nl/phppsdreader
     # Notes:#
     if (file_exists($this->psdReaderPath)) {
         include_once $this->psdReaderPath;
         $psdReader = new PhpPsdReader($fileName);
         if (isset($psdReader->infoArray['error'])) {
             return '';
         } else {
             return $psdReader->getImage();
         }
     } else {
         return false;
     }
 }