psliwa / image-optimizer

Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
MIT License
906 stars 141 forks source link

Help with image-optimizer #36

Closed steven26 closed 7 years ago

steven26 commented 7 years ago

Dear sir,

I installed all the needed libraries on Centos 6. If i open the file OptimizersTest.php, i get a blank screen, no errors, but the size of images in folder Resources are not changed.

And than i am lost how to use the image-optimizer. This will give the error: Fatal error: Class 'ImageOptimizer\OptimizerFactory'

`<?php namespace ImageOptimizer;

use ImageOptimizer\Exception\Exception; error_reporting(E_ALL); ini_set('display_errors', 1); require_once 'PHPUnit/Autoload.php'; $factory = new \ImageOptimizer\OptimizerFactory(); $optimizer = $factory->get(); $filepath = 'Resources/sample.jpg'; $optimizer->optimize($filepath); ?>`

Help would be appreciated.

Kind regards,

Steven

psliwa commented 7 years ago

You need to use composer in order to install and use this library - I will add info about this to the README soon. So assuming that you know what composer is and how to use it, you need to invoke composer require ps/image-optimizer:1.1.*.