Re: Get lenght (bytes) of pixels in GdkPixbuf



On Mon, 2003-02-10 at 12:40, Vladimir Djokic wrote:
      Good day,
      Developers!

      I'm stuck. In school project, have a NewStudentDlg, and among other
data to input, there is a student photo option. 
      I load GdkPixbuf from file, scale if needed, and create new GktImage
(from GdkPixbuf) to show in this dlg. But, since I'm using MySQL to
store student data, I need to get pixels (thats easy, there is a func:),
but NEED length of this data, too (want to store image in MySQL
database). I have been reading docs about GdkPixbuf, but made little
progress.

  It depends in how you store the information. Do you mean you store the
pixbuf as raw data in the database?
  The minimum buffer size holding the image would be:
        size = (height - 1)*rowstride + width*n_channels; (possibly, gdk-pixbuf
allocates height*rowstride, but some bytes at the end would be unused
this way.

  *However*, are you sure it's a good idea to store raw images? Wouldn't
it be better to save the pixbuf (gdk_pixbuf_save) to a file, and then
just store the file name in the database?


      If someone could just point me where to look (I know google is God:),
and what to read, so I can understand how this stuff works, or just tell
me what steps I need to take to get length of pixel data?

      Thanks,
      Vladimir.
-- 
Gustavo João Alves Marques Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]