vhs
vhs copied to clipboard
v:media.picture is not working together with image processing
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.
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...
Either:
- Pass a properly configured
FileReference
orFile
with crop definition assrc
; alternatively, define crop behavior in TS . - Or pre-process the input for
src
withf:uri.image
or other.
When passing a string value as src
the ViewHelper will not process the image at all.