In my Timber-based theme, I'm getting a single image from the media library using the following (based on Timber/Image):
<img src="{{ Image(678).src }}" alt="{{ Image(678).alt }}" srcset="{{ Image(678).srcset }}" sizes="{{ Image(678).img_sizes }}" />
However it's silly to repeatedly state the image id for each attribute.
Is there a single command that can spit out a fully populated image instance or does this call for a custom PHP function, and make it available to Timber?
For reference, the above code outputs this:
<img src="https://mywebsite.com/wp-content/uploads/2019/11/myimage.png" alt="This is the image!" srcset="https://mywebsite.com/wp-content/uploads/2019/11/myimage.png 1052w, https://mywebsite.com/wp-content/uploads/2019/11/myimage-150x150.png 150w, https://mywebsite.com/wp-content/uploads/2019/11/[email protected] 300w, https://mywebsite.com/wp-content/uploads/2019/11/myimage-768x768.png 768w, https://mywebsite.com/wp-content/uploads/2019/11/myimage-1024x1024.png 1024w, https://mywebsite.com/wp-content/uploads/2019/11/[email protected] 600w" sizes="(max-width: 1052px) 100vw, 1052px">