PDA

View Full Version : How to install Trimage on Linux?



Fli
11-03-2014, 11:28 PM
How to install Trimage (http://trimage.org/) image optimizer on Linux?
I did it this way:


wget https://github.com/Kilian/Trimage/archive/master.zip
unzip master.zip
cd Trimage-master
python setup.py install

or mirror:


wget http://internetlifeforum.com/files/Trimage.zip
unzip Trimage.zip
cd Trimage-master
python setup.py install

or debian:


apt-get install trimage

then i see Trimage installed:


man trimage


TRIMAGE(1) User Commands TRIMAGE(1)

NAME
trimage - losslessly optimizing png and jpeg liles


SYNOPSIS
trimage [options]


DESCRIPTION
Front-end to compress png and jpeg images via optipng, advpng, pngcrush and jpegoptim.


OPTIONS
-d directory, --directory=directory
Compresses images in directory.


-f filename, --file=filename
Compresses image.


-h, --help
Show help message.


-q, --quiet
Quiet mode.


-v, --verbose
Verbose mode (default).


--version
Show program version number.


SEE ALSO
advpng(1), jpegoptim(1), opt-png(1), opt-jpg(1), pngcrush(1), pngrecolor(1), pngstrip(1)


trimage 1.0.5 2011-07-11 TRIMAGE(1)

So to optimize image, one do command:

trimage -f filename.jpg
trimage -f filename.gif

To optimize images recursivelly:

find /home -type f -name "*.jpg" -o -name "*.png" -exec trimage -f {} \;
(i would backup before running that on /home)

This eror can happen on Trimage run:

Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/trimage/trimage.py", line 14, in <module> from PyQt4.QtCore import *ImportError: No module named PyQt4.QtCore
It is mentioned to do: apt-get install python-qt4
But on CentOS, python-qt4 is not there. There is "yum install PyQt4", but it request to install 40Mb of SW.. :/