Imagemagick/Graphicsmagick commands in fluid image viewhelper?

597 views Asked by At

Is it possible to get f:image or v:media.image or a similar available viewhelper to perform some classic TYPO3 imagemagick stunts, like converting an image to grayscale?

Like

10 = IMAGE
10.file.params = -type Grayscale

Or would I have to extend f:image with an own VH?

And If I'd have to do that: I guess it would be the right approach to just pass on these params to IM/GM, right? Where would I have to look to see how that's correctly done?

2

There are 2 answers

2
r4fx On BEST ANSWER

See this closed issue https://forge.typo3.org/issues/41347, this feature has existing patch, but was abandoned (see Christian Kuhn comment why -> https://review.typo3.org/#/c/21162/), so now you need an own VH.

Edit:

If you want to have special effects on images you can use CSS property today, just use simple CSS Filters, with pretty nice browsers support today http://caniuse.com/#feat=css-filters

Examples:

3
Heinz Schilling On

I use TypoScript to configure images and call them in fluid:

<f:cObject typoscriptObjectPath="lib.fluidResponsiveImages" data="{image.uid}"></f:cObject>

TypoScript example:

#
# TypoScript Setup: lib.fluidResponsiveImages
# Load after tt_content.t3s
#
lib.fluidResponsiveImages = IMAGE
lib.fluidResponsiveImages  {
    file {
        import.current = 1
        treatIdAsReference = 1
        width = 932
    }
    sourceCollection < tt_content.image.20.1.sourceCollection
    layoutKey < tt_content.image.20.1.layoutKey
    layout < tt_content.image.20.1.layout
    params < tt_content.image.20.1.params
}