vhs
vhs copied to clipboard
v:uri.image cropVariant
I using v:uri.image to create responsive image tags and lazy loading the different image scoures depening on resolution and pixel density. Each image has its own resolution and quality setting. Now i started my first Typo3 8.7 project and its not possible to use new image manipulation over cropVariant. I now use f:uri.image but this at the other hand has no quality settings.
Have you any plans to implement cropVariant into vhs?
Supporting cropVariants
should be as easy as adding the attribute cropVariant
to the ViewHelper and passing it to the $setup
array. The rest is handled by the TYPO3 core. Please consider adding this.
https://github.com/FluidTYPO3/vhs/blob/d14d9d1584d6267a18678170a8f0feb3679a6293/Classes/ViewHelpers/Media/Image/AbstractImageViewHelper.php#L156-L165
public function initializeArguments() {
// [...]
$this->registerArgument(
'cropVariant',
'string',
'Use crop variant if set.',
false,
'default'
);
}
$setup = [
// [...]
'cropVariant' => $this->arguments['cropVariant'] ?: 'default'
];
Shouldn't this also be added to the v:media.source viewhelper? The v:media.souce is used withig a v:media.picture in the example given in the VHS documentation.
Also in v:media.image
?
@yeldiRium As far as I can see the class ImageViewHelper
extends AbstractImageViewHelper
, thus it should be covered by adding it to AbstractImageViewHelper
.
Adding it to SourceViewHelper
however seems to be necessary as @rowild pointed out.