Skip to content

Quickstart

drotiro edited this page Aug 23, 2010 · 2 revisions

PostPic Quickstart

This guide explains how to setup PostPic in your database.

More detailed informations are found in the other wiki pages.

Step 1: Get the sources

PostPic’s sources are hosted at GitHub
Just click “Download Source” to download the source archive, or — if you are a git user — clone the public url displayed in home page.
If you are a github user and plan to contribute, you can fork your own copy of the repository.

Step 2: Compile and install

First of all, you need to have these softwares installed, with development packages:

  • PostgreSQL server
  • GraphicsMagick

On Ubuntu you can try this:

sudo apt-get install libgraphicsmagick-dev postgresql-server-dev-8.4 

To build the jdbc driver extension and the java example code, you need a jdk and ant too.

Now, build PostPic with

make

then

sudo make install

We’ll use an example java program in later steps, so let’s build it with

make jdbc examples

See the Compiling page for more information.

Step 3: Prepare the database for image processing

The make install command from previous step added the server extension to PostgreSQL’s $libdir, but to make it usable from clients we still need to load it into a database.

This can be done by logging in with an admin user and running the script postpic.sql, copied by the install in $sharedir/contrib. Eg:

cd $(pg_config --sharedir)
cd contrib #postpic.sql should be here
psql -U postgres myimgdb
postgres=# \i postpic.sql
postgres=# \q

The script creates the new image type and several functions to process images, query their attributes, etc.

Step 4: Play with the examples

The simplest way to play with PostPic is to import some images and query them with PostPicSQL.

  • Create example tables with the script create_example_tables_and_funcs.sql (it’s in the examples directory)
  • Import some image with postpic_import (in utils, see online help)
  • Go to exampleS/PostPicSQL/bin and run ‘ppsql’. Run some query and see the resulting images displayed.

For instance, to show a small preview of your images try this:

set mode thumbs
select square(the_img, 96) from images

Clone this wiki locally