-
Notifications
You must be signed in to change notification settings - Fork 22
Quickstart
This guide explains how to setup PostPic in your database.
More detailed informations are found in the other wiki pages.
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.
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
makethen
sudo make installWe’ll use an example java program in later steps, so let’s build it with
make jdbc examplesSee the Compiling page for more information.
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=# \qThe script creates the new image type and several functions to process images, query their attributes, etc.
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