Utility for extracting thumbnails from PSDs
A JPEG thumbnail is stored in every Adobe Photoshop document for quick previews and easy identification. This program finds that thumbnail and extracts it to its own file.
See the file format specification here.
make && sudo make install
psdthumb <in.psd> <out.jpg>