I have an extension where I need to create thumbnails. For this, I wrote some wrapper function.
public static function pictureGenerator($file, $title, $size_w, $size_h) { $cObj = t3lib_div::makeInstance('tslib_cObj'); $imgTSConfig = array(); $imgTSConfig['file'] = $file; $imgTSConfig['file.']['width'] = $size_w . 'm'; $imgTSConfig['file.']['height'] = $size_h . 'm'; $imgTSConfig['altText'] = empty($title) ? 'preview' : $title; $imgTSConfig['titleText'] = empty($title) ? 'preview' : $title; return $cObj->IMAGE($imgTSConfig); }
This function works fine while I use the path relative to TYPO3-Directory: For example: ../ typo3conf / ext / sd_filmbase / res / images / default_film.jpg
But as soon as I try to use an absolute System-Path like the one below, the image is no longer generated and "return $ cObj-> IMAGE ($ imgTSConfig)" returns NULL.
/var/www/vhosts/domain.com/httpdocs/path/to/picture/c.example.hq.jpg
This path is outside of TYPO3-Install-Directory - but is included in open_basedir (and safe_mode is Off).
I added the following path to open_basedir: /var/www/vhosts/domain.com/httpdocs/path/
And I tested with is_readable () if the file is read from my extension - and it returned true.
Image processing in the setup tool works great.
Do you have any ideas what else I could check? Or am I missing something substantial?
Btw: I am running TYPO3 4.6.1 and PHP 5.3.
DECISION:
Make Symlink in the Web Directory an external path. This symlink should either be in fileadmin / or typo3conf /
See also post konsolenfreddy.
source share