Coder Social home page Coder Social logo

squish's Introduction

squish

Requirements Status Build Status

Overview

Josh Benham's Image Optimization tool

A simple tool to optimize images for the web. Can use lossy and lossless optimizations or a combination of both.

Dependencies

Currently squish has two dependencies that will have to get installed seperately.

  1. imgmin to handle smart lossy image optimizations.
  2. image_optim to handle lossless image optimizations

Instructions

# grab the repo
$ git clone [email protected]:joshbenham/squish.git

# change into the squish directory
$ cd squish

# install python requirements
$ pip install --requirement requirements.txt

# symlink it to your bin directory
$ ln -s squish_r ~/bin/squish

Also make sure that your ~/bin directory is in your environment path.

Notes

In some versions of Ubuntu the pip install line fails because PIL cannot be installed correctly. You will need to follow link to get it working correctly.

Usage

Lossless compression

# on a file
$ squish_r --lossless file.jpg

# on a folder
$ squish_r --lossless folder/

Lossy compression

# on a file
$ squish_r --lossy file.jpg

# on a folder
$ squish_r --lossy folder/

squish's People

Contributors

joshbenham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

richo

squish's Issues

Install fails with python 2.7

Cloned the repo and ran pip install --requirement requirements.txt but it blows up with the following error:

vagrant@precise64:/usr/local/squish$ pip install --requirement requirements.txt
Downloading/unpacking PIL==1.1.7 (from -r requirements.txt (line 1))
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py

Downloading/unpacking PyYAML==3.10 (from -r requirements.txt (line 2))
Running setup.py egg_info for package PyYAML

Downloading/unpacking argh==0.15.1 (from -r requirements.txt (line 3))
Running setup.py egg_info for package argh

Requirement already satisfied (use --upgrade to upgrade): argparse==1.2.1 in /usr/lib/python2.7 (from -r requirements.txt (line 4))
Downloading/unpacking clint==0.3.1 (from -r requirements.txt (line 5))
Running setup.py egg_info for package clint

Downloading/unpacking envoy==0.0.2 (from -r requirements.txt (line 6))
Running setup.py egg_info for package envoy

Downloading/unpacking pathtools==0.1.2 (from -r requirements.txt (line 7))
Running setup.py egg_info for package pathtools

Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2 in /usr/lib/python2.7 (from -r requirements.txt (line 8))
Installing collected packages: PIL, PyYAML, argh, clint, envoy, pathtools
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
building '_imaging' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -IlibImaging -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o
_imaging.c:75:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;file='/usr/local/squish/build/PIL/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /tmp/pip-_78QIE-record/install-record.txt:
WARNING: '' not a valid package name; please use only.-separated package names in setup.py

running install

running build

running build_py

running build_ext

building '_imaging' extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -IlibImaging -I/usr/include -I/usr/local/include -I/usr/include/python2.7 -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o

_imaging.c:75:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1


Command /usr/bin/python -c "import setuptools;file='/usr/local/squish/build/PIL/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /tmp/pip-_78QIE-record/install-record.txt failed with error code 1
Storing complete log in /home/vagrant/.pip/pip.log
vagrant@precise64:/usr/local/squish$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.