Пример #1
0
 /**
  * Create new image pointer from input file (either gif/png, in case the wrong format it is converted by \TYPO3\CMS\Core\Imaging\GraphicalFunctions::readPngGif())
  *
  * @param string $file Absolute filename of the image file from which to start the icon creation.
  * @return resource|int If success, image pointer, otherwise -1
  * @access private
  * @see \TYPO3\CMS\Core\Imaging\GraphicalFunctions::readPngGif
  */
 public static function imagecreatefrom($file)
 {
     $file = GraphicalFunctions::readPngGif($file, $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png']);
     if (!$file) {
         return -1;
     }
     return $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png'] ? imagecreatefrompng($file) : imagecreatefromgif($file);
 }
Пример #2
0
 /**
  * Returns filename of the png/gif version of the input file (which can be png or gif).
  * If input file type does not match the wanted output type a conversion is made and temp-filename returned.
  *
  * @param string $theFile Filepath of image file
  * @param bool $output_png If set, then input file is converted to PNG, otherwise to GIF
  * @return string If the new image file exists, its filepath is returned
  * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Use \TYPO3\CMS\Core\Imaging\GraphicalFunctions::readPngGif() instead.
  */
 public static function read_png_gif($theFile, $output_png = false)
 {
     static::logDeprecatedFunction();
     $newFile = GraphicalFunctions::readPngGif($theFile, $output_png);
     return $newFile;
 }