PHPackages                             shel/neos-resource-import-preprocessor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. shel/neos-resource-import-preprocessor

ActiveNeos-plugin

shel/neos-resource-import-preprocessor
======================================

Neos Ui plugin to preprocess resource during import

1.0.1(1mo ago)032↑37.5%MITPHPPHP &gt;=8.2CI passing

Since Jul 16Pushed 1mo agoCompare

[ Source](https://github.com/Sebobo/Shel.Neos.ResourceImportPreprocessor)[ Packagist](https://packagist.org/packages/shel/neos-resource-import-preprocessor)[ Fund](https://www.amazon.de/hz/wishlist/ls/JEL60X51G2GA)[ GitHub Sponsors](https://github.com/sebobo)[ RSS](/packages/shel-neos-resource-import-preprocessor/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

Neos CMS plugin for preprocessing resources during import
=========================================================

[](#neos-cms-plugin-for-preprocessing-resources-during-import)

Processes filenames and resources during Neos CMS import to standardize naming and resize images. The processors are configurable and extendable.

Installation
------------

[](#installation)

```
composer require shel/neos-resource-import-preprocessor
```

Configuration
-------------

[](#configuration)

Copy the following configuration into your `Settings.yaml` to adjust the plugin's behavior:

```
Shel:
  Neos:
    ResourceImportPreprocessor:
      processFilenames:
        enabled: true
        processors:
          'replaceSpecialChars':
            class: 'Shel\Neos\ResourceImportPreprocessor\Processor\ReplaceSpecialCharsFilenameProcessor'
            options:
              # Regex pattern for characters to replace (default: replaces everything except a-zA-Z0-9._-)
              pattern: '/[^a-zA-Z0-9._-]/'
              # Replacement character (default: '-')
              replacement: '-'
      processResources:
        enabled: true
        processors:
          'resizeImages':
            class: 'Shel\Neos\ResourceImportPreprocessor\Processor\ResizeImageResourceProcessor'
            options:
              # Maximum width & height in pixels (images exceeding this will be scaled down, aspect ratio is preserved)
              maxWidth: 1920
              maxHeight: 1920
              # Options passed to Imagine's save() method (e.g. JPEG quality, PNG compression)
              saveOptions:
                quality: 90
```

### Available processors

[](#available-processors)

#### `ReplaceSpecialCharsFilenameProcessor`

[](#replacespecialcharsfilenameprocessor)

Replaces special characters in filenames using a regex pattern. Useful to ensure filenames only contain safe characters.

OptionTypeDescription`pattern``string`PHP regex pattern for characters to replace`replacement``string`Replacement character#### `ResizeImageResourceProcessor`

[](#resizeimageresourceprocessor)

Scales images down if they exceed the configured maximum dimensions. SVG images are skipped. Aspect ratio is always preserved.

OptionTypeDescription`maxWidth``int`Maximum width in pixels`maxHeight``int`Maximum height in pixels`saveOptions``array`Options passed to Imagine's `save()` method (see below)`allowedMimeTypes``list`MIME types to process (default: `['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/avif', 'image/bmp']`)The `allowedMimeTypes` option lets you restrict which image formats are processed. Any image whose MIME type is not in this list will be skipped and returned unchanged. This is useful if you only want to resize certain formats or want to avoid processing formats that might cause issues.

The processor uses the Imagine library with the vips driver and passes `unlimited: true` and `fail_on: none` options to vips when loading images. This allows it to gracefully handle truncated or corrupted images without crashing the PHP-FPM worker.

The `saveOptions` are passed directly to [Imagine's save method](https://imagine.readthedocs.io/en/latest/usage/introduction.html#saving-images). Common options:

OptionTypeSupported byDescription`quality``int`JPEG, WebP, AVIFImage quality (0–100)`png_compression_level``int`PNGCompression level (0–9, default: 6)`jpeg_sampling_factor``string`JPEGChroma subsampling (e.g. `'4:2:0'`)Example with custom save options:

```
Shel:
  Neos:
    ResourceImportPreprocessor:
      processResources:
        processors:
          'resizeImages':
            class: 'Shel\Neos\ResourceImportPreprocessor\Processor\ResizeImageResourceProcessor'
            options:
              maxWidth: 1920
              maxHeight: 1920
              saveOptions:
                quality: 85
                png_compression_level: 9
```

Example restricting to JPEG and PNG only:

```
Shel:
  Neos:
    ResourceImportPreprocessor:
      processResources:
        processors:
          'resizeImages':
            class: 'Shel\Neos\ResourceImportPreprocessor\Processor\ResizeImageResourceProcessor'
            options:
              maxWidth: 1920
              maxHeight: 1920
              allowedMimeTypes:
                - 'image/jpeg'
                - 'image/png'
```

Note: When using the vips driver, AVIF files are supported if your vips installation has AVIF support. The `allowedMimeTypes` list includes `image/avif` by default.

### Custom processors

[](#custom-processors)

Custom processors can be added by implementing either the `Shel\Neos\ResourceImportPreprocessor\Processor\ResourceProcessorInterface` or the `Shel\Neos\ResourceImportPreprocessor\Processor\FilenameProcessorInterface` interfaces.

Then they can be registered in the configuration.

### Disabling processors

[](#disabling-processors)

Individual processors can be disabled by setting them to `null` in the configuration:

```
Shel:
  Neos:
    ResourceImportPreprocessor:
      processFilenames:
        enabled: true
        processors:
          'replaceSpecialChars': ~
```

A whole processor group can be disabled by setting `enabled` to `false`:

```
Shel:
  Neos:
    ResourceImportPreprocessor:
      processFilenames:
        enabled: false
```

Sponsors
--------

[](#sponsors)

The public first release of this package was generously sponsored by [Vogel communications group](https://www.vogel.de).

License
-------

[](#license)

See [License](LICENSE.txt)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance92

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

41d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c9f106db319e8698dcb4aedfe8034f0442d379ebbd78fcd67b884999b2236f1?d=identicon)[Sebobo](/maintainers/Sebobo)

---

Top Contributors

[![Sebobo](https://avatars.githubusercontent.com/u/596967?v=4)](https://github.com/Sebobo "Sebobo (18 commits)")

---

Tags

neoscms

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/shel-neos-resource-import-preprocessor/health.svg)

```
[![Health](https://phpackages.com/badges/shel-neos-resource-import-preprocessor/health.svg)](https://phpackages.com/packages/shel-neos-resource-import-preprocessor)
```

###  Alternatives

[neos/neos

An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.

1151.1M869](/packages/neos-neos)[neos/neos-development-collection

Neos packages in a joined repository for pull requests.

267104.7k1](/packages/neos-neos-development-collection)[neos/media

The Media package

101.2M63](/packages/neos-media)[neos/neos-base-distribution

Neos Base Distribution

4366.7k](/packages/neos-neos-base-distribution)[flowpack/elasticsearch-contentrepositoryadaptor

This package provides functionality for using Elasticsearch on top of Neos.ContentRepository.Search

42408.9k10](/packages/flowpack-elasticsearch-contentrepositoryadaptor)[neos/eel

The Embedded Expression Language (Eel) is a building block for creating Domain Specific Languages

122.3M49](/packages/neos-eel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
