[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: save image and display image from postgresql
- From: Yann Droneaud <ydroneaud mandriva com>
- To: gtk-app-devel-list gnome org
- Subject: Re: save image and display image from postgresql
- Date: Wed, 23 Jul 2008 14:55:36 +0200
Le mercredi 23 juillet 2008 à 19:13 +0800, paragasu a écrit :
> i am very new to gtk programming. I am sorry for this beginner
> questions, but after asking
> google i fail the get the right answer. I hope this mailing list will help me.
>
> anyone can please point me a way on how to save image to postgresql
> database and
> display the image again.
>
You could use gdk_pixdata_from_pixbuf(), gdk_pixdata_serialize() to
store the image on the database server as a BLOB or converted to a
string encoded in Base64.
And use gdk_pixdata_deserialize(), gdk_pixbuf_from_pixdata() to convert
the data back to a GdkPixbuf for display.
See
http://library.gnome.org/devel/gdk-pixbuf/stable/gdk-pixbuf-inline.html
But, IMHO, storing image in a database is not the best way:
storing in database the path to an image stored on a filesystem could be
a better idea (on a single computer, the application will benefit from
the filesystem cache).
Regards
--
Yann Droneaud <ydroneaud mandriva com>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]