-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
65 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ImageOptimizer | ||
=========== | ||
PHP image optimizer for png, jpeg and gif files. It uses mozjpeg, pngquant and gifsicle for the optimization process. | ||
|
||
**This guide assumes you have mozjpeg, pngquant and gifsicle installed.** | ||
|
||
Installation | ||
----------- | ||
You can install this library with composer or include it manually in your project. | ||
|
||
Quick start | ||
----------- | ||
|
||
```php | ||
$optimizer = new Optimizer( | ||
array( | ||
Optimizer::PNGQUANT_PATH => '/usr/local/bin/pngquant', | ||
Optimizer::MOZJPEG_PATH => '/usr/local/bin/cjpeg', | ||
Optimizer::GIFSICLE_PATH => '/usr/local/bin/gifsicle' | ||
) | ||
); | ||
``` | ||
|
||
After this you can run the optimization process. If the optimization failed the method will throw an Exception, otherwise it returns TRUE. | ||
|
||
```php | ||
$optimizer->optimize('example.jpg', 'example-optimized.jpg')); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters