---
title: "Feature: #102624 - PSR-14 event for modifying image source collection"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-102624-1701943870"
source: "Changelog/13.0/Feature-102624-PSR-14EventForModifyingImageSourceCollection.rst"
typo3-version: "13.0"
typo3-major: 13
type: "feature"
issue: 102624
forge: "https://forge.typo3.org/issues/102624"
tags: ["Frontend", "PHP-API", "ext:frontend"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Feature: #102624 - PSR-14 event for modifying image source collection {#feature-102624-1701943870}

See [forge#102624](https://forge.typo3.org/issues/102624)

## Description {#description}

A new PSR-14 event `\TYPO3\CMS\Frontend\ContentObject\Event\ModifyImageSourceCollectionEvent`
has been introduced which serves as a drop-in replacement for the now removed
hook `$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection']`.

The event is being dispatched in `ContentObjectRenderer->getImageSourceCollection()`
for each configured `sourceCollection` and allows to enrich the final
source collection result.

To modify `getImageSourceCollection()` result, the following methods are available:

-   `setSourceCollection()`: Allows to modify a source collection based on the corresponding configuration
-   `getSourceCollection()`: Returns the source collection
-   `getFullSourceCollection()`: Returns the current full source collection, being enhanced by the current `sourceCollection`
-   `getSourceConfiguration()`: Returns the current `sourceCollection` configuration
-   `getSourceRenderConfiguration()`: Returns the corresponding renderer configuration for the source collection
-   `getContentObjectRenderer()`: Returns the current `ContentObjectRenderer` instance

## Example {#example}

The event listener class, using the PHP attribute `#[AsEventListener]` for
registration:

```php
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Frontend\ContentObject\Event\ModifyImageSourceCollectionEvent;

final class ModifyImageSourceCollectionEventListener
{
    #[AsEventListener]
    public function __invoke(ModifyImageSourceCollectionEvent $event): void
    {
        $event->setSourceCollection('<source src="bar-file.jpg" media="(max-device-width: 600px)">');
    }
}
```

## Impact {#impact}

Using the new PSR-14 event, it's now possible to manipulate the
`sourceCollection`'s, used for an `ImageContentObject`.
