Feature: #102755 - PSR-14 event for modifying getImageResource result
See forge#102755
Description
A new PSR-14 event 
        \TYPO3\
has been introduced which serves as a replacement for the now removed
hook 
        $GLOBALS.
The event is being dispatched just before 
        Content
is about to return the resolved 
        \TYPO3\ DTO.
The event is therefore in comparison to the removed hook always dispatched,
even if no 
        Image could be resolved. In this case, the
corresponding return value is 
        null.
Note
Instead of an 
        array 
        Content now handles
the image resource with the new 
        Image DTO.
This means, 
        Content returns either the new
DTO or null.
To modify the 
        get result, the following methods are available:
- set: Allows to set the- Image - Resource - () - Imageto return- Resource 
- get: Returns the resolved- Image - Resource - () - Imageor- Resource - null
- get: Returns the- File - () - $file, passed to the- getfunction- Image - Resource 
- get: Returns the- File - Array - () - $file, passed to the- Array - getfunction- Image - Resource 
Example
The event listener class, using the PHP attribute 
        # for
registration:
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Frontend\ContentObject\Event\AfterImageResourceResolvedEvent;
final class AfterImageResourceResolvedEventListener
{
    #[AsEventListener]
    public function __invoke(AfterImageResourceResolvedEvent $event): void
    {
        $modifiedImageResource = $event
            ->getImageResource()
            ->withWidth(123);
        $event->setImageResource($modifiedImageResource);
    }
}Impact
Using the new PSR-14 Event, it's now possible to modify the resolved
        get result.
Additionally, the 
        Image DTO allows an improved API as
developers do no longer have to deal with unnamed array keys but benefit
from the object-oriented approach, using corresponding getter and setter.