vhs icon indicating copy to clipboard operation
vhs copied to clipboard

v:media.picture is not working together with image processing

Open kthalmann opened this issue 7 years ago • 1 comments

I'm trying to make use of v:media.picture and v:media.source for responsive image handling:

<v:media.picture src="{image.url}" alt="{image.alternative -> v:or(alternative: image.name)}"> <v:media.source media="(max-width: 767px)" maxH="250" /> <v:media.source maxH="420" /> </v:media.picture>

But the image(s) rendered are not cropped like i did with the image manipulation in TYPO3 backend.

kthalmann avatar Jun 20 '17 07:06 kthalmann

Try <f:uri.image image="{image}" .... /> as an alternative and render the picture element manually. This will keep the cropped image dimensions.

Have you tried putting {image} instead of {image.url} in the src argument? I haven't used this particular viewhelper lately but last time I checked, cropping wasn't considered/respected. Could have changed though in the meantime...

Bjoelin avatar Jul 18 '17 13:07 Bjoelin

Either:

  • Pass a properly configured FileReference or File with crop definition as src; alternatively, define crop behavior in TS .
  • Or pre-process the input for src with f:uri.image or other.

When passing a string value as src the ViewHelper will not process the image at all.

NamelessCoder avatar Jul 25 '23 11:07 NamelessCoder