Some GhostScript tricks
This blog post is about three tiny bash scripts which all use Ghostscript to modify some files. I use all three script for purposes related to latex. The scripts are created for linux (obviously) but the Ghostscript tricks inside will also work in a windows environment.
The three scripts provide the functionality to:
- batch convert .eps to .pdf graphics
- batch convert .eps and .pdf to png graphics
- reduce the filesize of a .pdf report
Photosort, update
Recently, I wrote about a bash script (photosort) that can combine two sets of photos into one chronological set using the timestamp from the EXIF information. Today, a friend (Tom) send me two bash scripts which greatly complement the photosort script. Especially, when one of your photo sets has an incorrect timestamp, e.g. due to misconfiguration of the camera.
- One script is called photoshift, it shifts the timestamp of one set with a constant
- The other is called photosync, it auto shifts one set using one photo of each set which are both taken at same moment.
[Update]
Tom has taken the scripts to a new level, check his work out here:
http://www.tdegeus.com/linux/#phototools
[/Update]
Solving linear systems with a magic “\”
Whenever it is possible to write your problem to a system of linear equations you are very close to solving the problem, when using Matlab. This is one of the most basic solving techniques in Matlab, and also well documented in the help, still I want to illustrate its use using two simple but very useful examples, resulting in two matlab functions, one will allow you to fit a plane through a 3D data set, the second will fit a circle through a 2D data set.
One event, multiple cameras
Nowadays everybody has a photo camera, and everybody brings their own to the event. When you bundle all pictures after the event, viewing them is a bit awkward because each batch of photos is sorted on its own. It is like going through the holiday multiple times. I’ve written a little bash script which will merge two folders into one renaming the photos in order according to the timestamp in the EXIF information. If you don’t know what bash is then you are probably on windows, check out Stamp in stead it will do something similar.