netresearch / nr-image-optimize
Add capability to optimize the delivered images to benefit from better compression and smaller image size. This extension also add the ability to process images only if it is really requested.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 5
Type:typo3-cms-extension
Requires
- php: ^8.1 || ^8.2 || ^8.3 || ^8.4
- intervention/image: 3.7.2 || 3.11.1
- typo3/cms-core: ^11.5 || ^12.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.1
- friendsoftypo3/phpstan-typo3: ^0.9
- overtrue/phplint: ^3.4 || ^9.0
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.5
- ssch/typo3-rector: ^2.0 || ^3.0
- typo3/testing-framework: ^6.0 || ^7.0 || ^8.0
This package is auto-updated.
Last update: 2025-09-13 10:06:49 UTC
README
Advanced image optimization extension for TYPO3 CMS that provides lazy image processing, modern format support, and performance optimization.
Features
- 🚀 Lazy Image Processing: Images are only processed when they are actually requested
- 🎨 Modern Format Support: WebP and AVIF with automatic fallback
- 📱 Responsive Images: Built-in ViewHelper for srcset generation
- âš¡ Performance Optimized: Middleware-based processing for efficiency
- 🔧 Intervention Image: Powered by the Intervention Image library
- 📊 Core Web Vitals: Improves LCP and overall page performance
Requirements
- PHP 8.1, 8.2, 8.3, or 8.4
- TYPO3 11.5 or 12.x
- Intervention Image library (automatically installed via Composer)
Installation
Via Composer (recommended)
composer require netresearch/nr-image-optimize
Manual Installation
- Download the extension from the TYPO3 Extension Repository
- Upload to
typo3conf/ext/
directory - Activate the extension in the Extension Manager
Configuration
The extension works out of the box with sensible defaults. Images are automatically optimized when accessed through the /processed/
path.
ViewHelper Usage
{namespace nr=Netresearch\NrImageOptimize\ViewHelpers} <nr:sourceSet file="{image}" width="1200" height="800" quality="85" sizes="(max-width: 768px) 100vw, 50vw" />
Supported Parameters
file
: The image file resourcewidth
: Target width in pixelsheight
: Target height in pixelsquality
: JPEG/WebP quality (1-100)sizes
: Responsive sizes attributeformat
: Output format (auto, webp, avif, jpg, png)
Development
Running Tests
# Run all tests composer ci:test # Run specific tests 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:rector # Code quality
Architecture
The extension uses a middleware approach for processing images:
- ProcessingMiddleware: Intercepts requests to
/processed/
paths - Processor: Handles image optimization and format conversion
- SourceSetViewHelper: Generates responsive image markup
Performance Considerations
- Images are processed only once and cached
- Supports browser-native lazy loading
- Automatic format negotiation based on Accept headers
- Optimized for CDN delivery
License
This extension is licensed under the GPL-2.0-or-later license. See LICENSE file for details.
Support
For issues and feature requests, please use the GitHub issue tracker.
Credits
Developed by Netresearch DTT GmbH