[Vala] Problems retrieving binary data from a sqlite3 database BLOB column
- From: Iñigo Serna <inigoserna gmail com>
- To: vala-list gnome org
- Subject: [Vala] Problems retrieving binary data from a sqlite3 database BLOB column
- Date: Sun, 26 Jun 2011 00:24:48 +0200
Hi,
I have problems retrieving binary data from a sqlite3 DB.
One of the columns of the database (f.e., number 3) is a BLOB with png images.
Using FileUtils.set_data("test.png", (uint8[]) smtm.column_blob(3));
writes a 8-bytes file with the first bytes of the image ("PNG" header
and some other numbers)
I'm sure the query is ok as I also retrieve other fields in the same
query and even stmt.column_bytes(3) returns the correct size of the
image.
Documentation explains "smtm.column_blob()" returns a void * so I
guess I have to cast to uint8[] to use FileUtils.set_data.
What am I doing wrong?
Thanks,
Iñigo Serna
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]