[TYPO3-UG US] [typo3 us] Resize an image inside a plugin?

Nik Wakelin munkywrench at gmail.com
Wed Jun 14 03:43:26 CEST 2006


Hi All,

I have been tearing out my hair trying to figure this one out.

I want to dynamically resize an image sent in a plugin - like this:

<code>
$imgTSConfig = $this->conf['personImage.'];
$imgTSConfig['file'] = 'uploads/tx_plugin/' .
$this->internal['currentRow'][$fN];
return $this->cObj->IMAGE($imgTSConfig);
</code>

(code from the Plugin class' getFieldContent() method, as in the walkthroughs).

I have read through all the documentation, watched all the videos.
Kasper does it by using a Typoscript file inside the plugin base
directory and using something like:

personImage.file.width = 50

But I can't seem to a) find the file he used (I created my extension
via the Kickstarter in 4.0 - are the docs out of date) and b) even if
I create the file, it doesn't seem to be being "listened" to.

I tried:

<code>
$imgTSConfig = $this->conf['personImage.'];
$imgTSConfig['file'] = 'uploads/tx_plugin/' .
$this->internal['currentRow'][$fN];
$imgTSConfig['file']['width'] = 50;  //NOTE NEW LINE
return $this->cObj->IMAGE($imgTSConfig);
</code>

But this just makes Typo3 render the name of the current page inside
the HTML, rather than an html <img> tag.

The resizing tests and ImageMagick config inside  my installer tool
all run without a hitch.

Help?

Thanks,

Nik Wakelin

-- 
[ munkywrench development ]
http://munkywrench.co.nz
munkywrench at gmail.com
(027) 424 5433



More information about the TYPO3-UG-US mailing list