Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 9, 2024 via composer

spatie/image-optimizer 1.7.2

Easily optimize images using PHP
Package summary
Share
0
issues
1
license
3
MIT
Package created
2 Jul 2017
Version published
3 Nov 2023
Maintainers
1
Total deps
3
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
psr/log@3.0.0
spatie/image-optimizer@1.7.2
symfony/process@v7.0.7
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of spatie/image-optimizer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
psr/log3.0.06.77 kBMIT
prod
symfony/processv7.0.7-MIT
prod

Visualizations

Frequently Asked Questions

What does spatie/image-optimizer do?

The Spatie Image Optimizer package offers an easy and efficient solution for optimizing images in PHP. It supports a variety of image formats such as PNGs, JPGs, WEBPs, AVIFs, SVGs, and GIFs. This tool functions by running images through a series of image optimization tools, resulting in reduced image size and improved loading times, all while maintaining the image quality.

How do you use spatie/image-optimizer?

Using the Spatie Image Optimizer is straightforward. Start by installing it via Composer with the command composer require spatie/image-optimizer. Once installed, you can optimize an image file by executing a simple piece of code:

use Spatie\ImageOptimizer\OptimizerChainFactory;

$optimizerChain = OptimizerChainFactory::create();
$optimizerChain->optimize($pathToImage);

Where $pathToImage is the path to your image.

Please keep in mind that the original image will be overwritten by its optimized version.

In case you want to keep the original image intact, you can use the optimize method, providing a second argument as the place to write the optimized image:

$optimizerChain->optimize($pathToImage, $pathToOutput);

Where $pathToOutput is the path to save the optimized image.

Where are the spatie/image-optimizer docs?

The documentation of Spatie Image Optimizer package can be read directly in the package's GitHub repository, here. The readme file contains step-by-step tutorials, code examples, details of functionalities, and contributing guidelines. It offers a comprehensive guide about how to use and customize the package according to your needs.