Skip to content
forked from davgothic/smushit

SmushIt is a PHP client for the popular Yahoo! image compression web service Smush.it

License

Notifications You must be signed in to change notification settings

luismaf/SmushIt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

SmushIt

SmushIt is a PHP client for the popular Yahoo! image compression web service Smush.it

Basic Usage

// Require the SmushIt source file
require_once 'smushit.php';

// Initialise the Smushit client
$smushit = new SmushIt();

// Compress remote image and return result object
$remote_result = $smushit->compress('http://www.example.com/some/path/to/an/image.jpg');
print_r($remote_result);
//	stdClass Object
//	(
//		[src] => http://www.example.com/some/path/to/an/image.jpg
//		[src_size] => 22957
//		[dest] => http://smushit.zenfs.com/results/50c57e58/smush/image.jpg
//		[dest_size] => 22519
//		[percent] => 1.91
//	)

// Compress local image and return result object
$local_result = $smushit->compress('/some/path/to/an/image.jpg');
print_r($local_result);
//	stdClass Object
//	(
//		[src] => image.jpg
//		[src_size] => 22957
//		[dest] => http://smushit.zenfs.com/results/50c57e58/smush/image.jpg
//		[dest_size] => 22519
//		[percent] => 1.91
//	)

Requirements

  • PHP 5.2+
  • PHP JSON extension
  • PHP cURL extension

Changelog

  • 1.1

  • 1.0

    • Initial Public Release

License

SmushIt is free and licensed under the MIT license

About

SmushIt is a PHP client for the popular Yahoo! image compression web service Smush.it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published