PHPackages                             neo/smushit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. neo/smushit

ActiveLibrary

neo/smushit
===========

Adds a wrapper around the Yahoo! Smushit service.

010PHP

Since Dec 21Pushed 12y agoCompare

[ Source](https://github.com/neoighodaro/smushit)[ Packagist](https://packagist.org/packages/neo/smushit)[ RSS](/packages/neo-smushit/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Smush.it API Library
====================

[](#smushit-api-library)

[![Build Status](https://camo.githubusercontent.com/fb897ef403d99b83e1ac3c32181b63e59b6e1dd5c02bc08b64a076ea16a8c835/68747470733a2f2f7472617669732d63692e6f72672f437265617469766974794b696c6c732f736d75736869742e706e67)](https://travis-ci.org/CreativityKills/smushit)

This is a library that makes it easy to use the [Smush.it](http://smushit.com) API on your projects. Usage is easy, first install the library by unzipping to your library directory or better still using composer:

Requirements
------------

[](#requirements)

- JSON extension
- cURL extension

Installation
------------

[](#installation)

### Using Composer

[](#using--composer)

Add this to your composer file:

```
"require" : {
	"neo/smushit" : "dev-master"
}

```

Then you can now run your `composer install` command and let it install all the dependencies.

Usage
-----

[](#usage)

To smush an image you should do this:

```
$original_image = 'http://placehold.it/300x300';

try
{
    $response = Neo\Smushit\Smushit::make($original_image);

	$resized = $response->dest;
}
catch(Neo\Smushit\Exception\SmushitException $e)
{
	$resized = $original_image;
}

```

Here is a sample response that can help you decode exactly how to handle various responses:

#### Successful response

[](#successful-response)

```
{
	"src":"http://placehold.it/300x300",
	"src_size":1200,
	"dest":"http://ysmushit.zenfs.com/results/c1c4ef27%2Fsmush%2F300x300.png",
	"dest_size":921,
	"percent":"23.25",
	"id":""
}

```

#### Unsuccessful response

[](#unsuccessful-response)

```
{
	"src":"http://placehold.it",
	"error":"Could not get the image",
	"id":""
}

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cdfba6ac9dc28ba4134c841782ef374a05e6fb57974b0f106d64cf17e971db39?d=identicon)[neoighodaro](/maintainers/neoighodaro)

### Embed Badge

![Health badge](/badges/neo-smushit/health.svg)

```
[![Health](https://phpackages.com/badges/neo-smushit/health.svg)](https://phpackages.com/packages/neo-smushit)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
