Installation
Via Composer (recommended)
composer require netresearch/nr-image-optimize
Manual installation
- Download the extension from the TYPO3 Extension Repository.
- Upload to
typo3conf/.ext/ - Activate the extension in the Extension Manager.
Setup
The extension works out of the box after installation:
- The frontend middleware picks up any request to the
/processed/path and produces a variant on demand. - The PSR-14 event listener for
AfterFileAddedEventandAfterFileReplacedEventruns on every new or replaced image.
No additional configuration is required.
Tip
For best results, ensure that your server has the Imagick or GD PHP extension installed. The backend maintenance module can verify all prerequisites for you (see System requirements check).
Optional: install optimizer binaries
The automatic on-upload compression and the
nr:image:optimize CLI command call
out to optipng, gifsicle, and jpegoptim. The
nr:image:analyze command is purely
heuristic and does not require these binaries.
Install whichever tools you need and make them available in
$PATH:
sudo apt-get install optipng gifsicle jpegoptim
brew install optipng gifsicle jpegoptim
To pin a specific path (useful in containerized environments) set one or more of the following environment variables:
OPTIPNG_BIN- Absolute path to
optipng. GIFSICLE_BIN- Absolute path to
gifsicle. JPEGOPTIM_BIN- Absolute path to
jpegoptim.
A set-but-invalid override is authoritative: the tool is
reported unavailable. There is no silent fallback to $PATH.
Tip
If no supported binary is installed, the on-upload
listener skips optimization silently. The
nr:image:optimize CLI command, by contrast, reports
the missing tools and exits with failure so an operator
running a bulk job gets immediate feedback.
nr:image:analyze works regardless because it never
invokes an external binary.