[TYPO3-english] got cObj->IMAGE in backend to work, but ...
Thomas Appel
appel at gmx.net
Mon Jan 17 16:47:41 CET 2011
Hi there
For a frontend gallery plugin I need some image conversion to be done in the typo3 backend, e.g when a gallery is saved, because images are not rendered on frontend but requested via eID and returned as ja JSON string.
The conversionscript is called from a TCE hook. I managed to get an almost complete FE user session with TSFE and a working cObj, then the images are called like this:
$plugin->conf['images']['image'] = IMG_RESOURCE;
$plugin->conf['images']['image.']['file.']['width'] = 400;
$plugin->conf['images']['image.']['file.']['height'] = 280;
$plugin->conf['images']['image.']['file'] = 'uploads/pluginfolder/image.jpg';
$plugin->cObj->getImgResource($plugin->conf['images']['image.']['file'], $plugin->conf['images']['image.']['file.']);
The problem is, that, in my case, the conversion fails in class tslib_cObj at about line 5520:
$GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile'] = $theImage;
$GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile_mtime'] = @filemtime($theImage);
I can call my script from a "real" FE session an it works. debug($theImage) prints out the relative path to the image file ('uploads/pluginfolder/image.jpg') but gets validated in filemtime($theImage) (but why?).
Called from the backend $theImage prints put the same string (relative path) but filemtime($theImage) fails (which seems to me the more logical case).
So, what I don't get is, why does filemtime apparently know the "missing" full path to the image in the first case?
I think this is the missing link, to get my backend image conversion to work.
Kind regards, Thomas
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Thomas Appel | Dipl. Designer (FH) | phone: +49160 97979 694 | mail: appel at gmx.net
More information about the TYPO3-english
mailing list