Backgroup:
Currently, in order to pass ImageValueObject to a pattern, you are doing preprocess to prepare the image e.g. here. I think, this is very complex and requires to do preprocess for each entity type and each image field!
Solution:
To avoid all these preprocesses, I suggest to create a twig extension that converts a render array that contains ImageItem to ImageValueObject.
Example from UCPKN:
Find the extension here
Find usages example here
Backgroup: Currently, in order to pass ImageValueObject to a pattern, you are doing preprocess to prepare the image e.g. here. I think, this is very complex and requires to do preprocess for each entity type and each image field!
Solution: To avoid all these preprocesses, I suggest to create a twig extension that converts a render array that contains ImageItem to ImageValueObject.
Example from UCPKN: Find the extension here Find usages example here
Please let me know your thoughts?