0

Here's a PHP snippet from my class called 'Image'.

Here is the full function inside my class

protected function _output( $save_in = null, $quality, $filters = null ) {
  switch ($this->_mime_type) {
    case self::IMAGETYPE_JPEG :
    case self::IMAGETYPE_JPG :
      return imagejpeg ( $this->_image, $save_in, 65 );
      break;
    default :
      trigger_error ( 'Image cannot be created.', E_USER_NOTICE );
      break;
  } // end switch
} // end method

I want to then use Smush.it to compress this newly resized image before I save the modified file.

I found this code line at GitHub GhislainPhu/php-lib-smushit, but I'm not sure how to call this class within my own class.

$smushit = new SmushIt('/path/to/myimage.jpg');

Can anyone help me? This will help so much with page speed.

NotAnotherCliche
  • 381
  • 1
  • 4
  • 18

0 Answers0