Retrieving images from Postgres with C++

From: "Johan C(dot) de Koning" <johan(dot)de(dot)koning(at)geodan(dot)nl>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Retrieving images from Postgres with C++
Date: 2005-08-02 08:02:32
Message-ID: 20050802080339.D61DE52EA4@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello,

I stored some images as bytea in a Postgres table. I use a bytea because
when I do a select on this table I want to get more then one result and in a
stream. Using the large objects method export the files to the harddisk
first and I think this will only work for one large object at a time
(correct me if I am wrong, but storing images first on the harddisk will
result in some performance penalities).

Within C++ I do a binary cursor select and get the image inside a char*. I
want this image to be used as a texture but before I can use this I need to
now some information about this image (meta data like width, height, color
depth etc). I wanted to use the libjpeg library for this, but this one is
only accepting FILE* as input. I tried searching for converting a char* to a
FILE* but it looks like this is not possible.

Does anybody have some experience with getting images outside the database
and use them I a library like libjpeg.

Thanks for your help,

Best regards,

Johan de Koning

Browse pgsql-novice by date

  From Date Subject
Next Message Walker, Jed S 2005-08-02 15:49:19 Make year 01/01/0001 but leave timestamp alone
Previous Message John DeSoi 2005-08-01 23:09:42 Re: os x and initdb data directory