[TYPO3-english] got cObj->IMAGE in backend to work, but ...

Thomas Appel appel at gmx.net
Wed Jan 19 01:08:11 CET 2011


Got it, so simple, just didn't think about it…

here it is: 

first solution (will work, but it's a bit nasty)

		if (!file_exists('uploads')){
			$symlinkPath = PATH_site.'uploads uploads';
			if ('win') {
				'junction.exe -s '. $symlinkPath;
			}
			else {			
				$cmd = 'ln -s '. $symlinkPath;			
			}
			exec($cmd);
		}
		..
		$cObj->IMAGE…

second solution: just change the directory and change it right back after cobj->file operations (which seems to be the more elegant way, found this here: http://blog.netzelf.de/lang/de/tipps-und-tricks/tslib_cobj-image-im-backend)

		$currentDir = getcwd();
		chdir(PATH_site);

		$cObj->IMAGE…

		chdir($currentDir);

et voila 


			
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Thomas Appel | Dipl. Designer (FH) | phone: +49160 97979 694 | mail: appel at gmx.net



Am 19.01.2011 um 00:01 schrieb Thomas Appel:

> I have considered this, but I fear this might be a performance issue, since I have to create the TSFE object, init the template etc.  for getting the plugin configs (image size can be set by either typoscript or flexform).
> I haven't figured it out yet how to get arround my rel.path problem, so using tslib_cObj in eID might be the only working solution. 
> 
> If someone has some good advice on this, I would appreciate it :) (haven't found anything in die docs so far).
> 
> Kind regards, Thomas
> 
> : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
> Thomas Appel | Dipl. Designer (FH) | phone: +49160 97979 694 | mail: appel at gmx.net
> 
> 
> 
> Am 18.01.2011 um 09:38 schrieb Dmitry Dulepov:
> 
>> Hi!
>> 
>> Thomas Appel wrote:
>>> 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.
>> 
>> What prevents you from using tslib_cObj in eID?
>> 
>> -- 
>> Dmitry Dulepov
>> TYPO3 core&security team member
>> E-mail: dmitry.dulepov at typo3.org
>> Web: http://dmitry-dulepov.com/
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
> 
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list