nerdlichter / contao-image-optimizer-bundle
Optimizing PNGs, JPGs, SVGs and GIFs
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 180
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 1
Open Issues: 6
Type:contao-bundle
Requires
- php: >=7.2
- ext-exif: *
- contao/core-bundle: ^4.4
- spatie/image-optimizer: ^1.1
Requires (Dev)
- contao/manager-plugin: ^2.0
- phpunit/phpunit: ^6.0
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
- dev-master / 1.0.x-dev
- 1.0
- dev-dependabot/composer/contao/core-bundle-4.9.6
- dev-dependabot/composer/symfony/dependency-injection-4.2.12
- dev-dependabot/composer/symfony/var-exporter-4.4.11
- dev-dependabot/composer/symfony/http-foundation-4.2.12
- dev-dependabot/composer/symfony/security-http-4.2.12
- dev-dependabot/composer/symfony/cache-4.2.12
This package is auto-updated.
Last update: 2023-03-24 22:08:11 UTC
README
Optimize Images via Console Call.
Uses the beautiful package from spatie/image-optimize
Installation
Debian/Ubuntu:
sudo apt-get install jpegoptim sudo apt-get install optipng sudo apt-get install pngquant sudo apt-get install gifsicle
MacOS:
brew install jpegoptim brew install optipng brew install pngquant brew install gifsicle
Add this Package to your Contao 4.* Installation:
composer require nerdlichter/contao-image-optimizer-bundle
Console Usage
Single File
➜ contao-source cc nl-image:optimize --path="assets/images/5/Karibik.jpg" --dry-run Performing dry run! No Changes will be made Optimizing assets/images/5/Karibik.jpg Total Bytes: 13165 / 13104 Change Percentage: 99.54%
Path
➜ contao-source cc nl-image:optimize --path="assets/images/5/" --dry-run Performing dry run! No Changes will be made Using path "assets/images/5/" Found 4 images Optimizing /Users/max/dev/demo/assets/images/5/slider_big-c-b20ea066.png Optimizing /Users/max/dev/demo/assets/images/5/slider_big-c-9d285542.jpg Optimizing /Users/max/dev/demo/assets/images/5/contao_extensions-f643ddd6.png Total Bytes: 156292 / 66626 Change Percentage: 42.63%
Backup
➜ contao-source cc nl-image:optimize --path="assets/images/5/" --backup Using path "assets/images/5/" Found 4 images Optimizing /Users/max/dev/demo/assets/images/5/slider_big-c-b20ea066.png Created Backup /Users/max/dev/demo/assets/images/5/slider_big-c-b20ea066.png.original Optimizing /Users/max/dev/demo/assets/images/5/slider_big-c-9d285542.jpg Created Backup /Users/max/dev/demo/assets/images/5/slider_big-c-9d285542.jpg.original Optimizing /Users/max/dev/demo/assets/images/5/contao_extensions-f643ddd6.png Created Backup /Users/max/dev/demo/assets/images/5/contao_extensions-f643ddd6.png.original Total Bytes: 156292 / 66626 Change Percentage: 42.63%