Reputation: 240
i want to Flip a bunch of Images vertically. In Typoscript i would do that with filelist and the GIFBUILDER Object.
But my Situation is now, that i use a custom Plugin with Extbase Classes and a Fluid Template. I'm inserting the Images via ...
Does anybody know a good way to vertically flip these images before showing them? Any Combination of Typoscript and Fluid maybe?
Thanks for your help!
Upvotes: 1
Views: 418
Reputation: 240
I solved it like this:
In my Extbase Controller i have instantiated t3lib_stdGraphic an transformed the imageas via Imagick. The i saved this image to a directory -> Because i need it in a persistent memory.
The code maybe helpful because i didn't found any good resource for imagick-using in Extbase.
$this->stdGraphic = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_stdGraphic' );
$this->stdGraphic->absPrefix = PATH_site;
$this->stdGraphic->init();
$data = getimagesize("fileadmin/buegel_anprobe/".$artikel->getKurznr().".png");
$width = $data[0];
$height = $data[1];
$transform = $this->stdGraphic->imageMagickConvert("fileadmin/".$artikelname.".png",'png', $width, $height, ' -flop', '', '', 1);
$filepath = $transform[3]
' -flop' is the important argument to flip the image vertically
Then i passed the path to the fluid template and insert it via image-viewhelper
Good resource was the following reference: http://doc-typo3.ameos.com/4.1.0/classt3lib__stdGraphic.html
Upvotes: 1
Reputation: 2331
You have two options in my eyes:
First to write your typoscript as usual (e.g. lib.marks.YOUR-IMAGES = CONTENT
or something) and render it via <f:cObject typoscriptObjectPath="lib.marks.YOUR-IMAGES"/>
.
Second is to write your own view helper and extending the image view helper included in fluid. You can put your special config in there and use it instead of the normal one.
Upvotes: 0