Developer reference
Architecture
The extension uses a middleware-based approach for image processing:
- ProcessingMiddleware intercepts frontend requests
matching the
/processed/path. - Processor handles image optimization, format conversion, and caching.
- SourceSetViewHelper generates responsive
<img>markup in Fluid templates. - MaintenanceController provides the backend module for statistics and cleanup.
Directory structure
Processing middleware
- class ProcessingMiddleware
-
- Fully qualified name
-
\Netresearch\
Nr Image Optimize\ Middleware\ Processing Middleware
Frontend middleware registered before
typo3/cms-frontend/site. Intercepts requests whose path starts with/processed/and delegates image processing to the Processor class.
Processor
- class Processor
-
- Fully qualified name
-
\Netresearch\
Nr Image Optimize\ Processor
Core image processing engine. Parses the requested URL to extract dimensions, quality, mode, and format parameters. Uses the Intervention Image library for actual image manipulation. Processed images are cached on disk to avoid repeated processing.
SourceSetViewHelper
Testing
Run the full test suite
composer ci:test
Copied!
Individual test commands:
Available test commands
composer ci:test:php:cgl # Code style
composer ci:test:php:lint # PHP syntax
composer ci:test:php:phpstan # Static analysis
composer ci:test:php:unit # PHPUnit tests
composer ci:test:php:rector # Code quality
Copied!