SoX – Sound eXchange

July 15, 2009

SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, and, as an added bonus, SoX can play and record audio files on most platforms.

For more details, please view this link

http://sox.sourceforge.net/

very useful tool for online sound manipulation

Thumbnail Generation

July 15, 2009

Learn how to generate thumbnails at the Linux command prompt.

The article assumes you have Imagemagick and OpenOffice installed on your Linux System.

To generate a thumbnail of an Image:
$ convert -thumbnail 200 abc.png thumb.abc.png

This will create a thumbnail of the abc.png image with 200px width.
$ convert -thumbnail x200 abc.png thumb.abc.png

This will create a thumbnail of the abc.png image with 200px height.

To generate a thumbnail of a PDF Document
convert -thumbnail 400×300 test.pdf test.png

This will create a thumbnail of the PDF document with dimensions 400×300px

What if you require a thumbnail of only first page of PDF?
Well, this will do it for you
convert -thumbnail x300 test.pdf[0] test.png

And the following
$ convert -thumbnail x300 test.pdf test.gif

will create an animated gif having all the pages from the PDF document.

To generate a thumbnail of a Word Document

Step 1
/opt/OpenOffice1.1.5/program/soffice -invisible -headless -norestore  “macro:///Standard.Module1.ExportAsPDF(“somefile.doc”,”somefile.pdf”)”

Convert Doc to PDF using Open Office

Step2
convert -thumbnail x300 somefile.pdf[0] somefile.png

Convert PDF first page to thumbnails.

Hope you will find the above information useful.

You can combine the information above and create a shell script if required. You can also use the above in Web Applications using PHP.

To call a shell script from PHP use shell_exec().

See here for more information on how to execute shell scripts from PHP
http://in.php.net/shell_exec

Thats all!!