[Gambas-user] Issue 629 in gambas: Unable to read blob data saved in PostgreSQL

gambas at ...2524... gambas at ...2524...
Thu Jul 23 10:44:09 CEST 2015


Status: New
Owner: ----
Labels: 3.7.1 Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 629 by isaf... at ...626...: Unable to read blob data saved in  
PostgreSQL
https://code.google.com/p/gambas/issues/detail?id=629

  ____________________________________________________________
1) with PostgreSQL retriving blob data is producing corrupt file. However  
it is working well with MySQL or Sqlite3

2) [System]
Gambas=3.7.1
OperatingSystem=Linux
Kernel=3.16.0-44-generic
Architecture=x86
Distribution=Ubuntu 14.04.2 LTS
Desktop=GNOME
Theme=QGtk
Language=en_US.UTF-8
Memory=1948M
[Libraries]
Cairo=libcairo.so.2.11301.0
Curl=libcurl.so.4.3.0
DBus=libdbus-1.so.3.7.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.204.0
GTK+3=libgtk-3.so.0.1000.8
GTK+=libgtk-x11-2.0.so.0.2400.23
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.44.0.0
Qt4=libQtCore.so.4.8.6
SDL=libSDL-1.2.so.0.11.4

3) Gambas 3.7.1 (using PPA for Ubuntu 14.04)

4) I use gambas method to create a table with blob field.
     Dim hTable As Table

     hTable = $newCon.Tables.Add("tblimage")
     hTable.Fields.Add("fldid", db.Serial)
     hTable.Fields.Add("fldpic", db.Blob)
     hTable.PrimaryKey = ["fldid"]
     hTable.Update

I use gambas method to insert image file in the above table.
   Dim res As Result

   res = $newCon.Create("tblimage")
   res["fldpic"] = File.Load("/home/safiur/picture.png")
   res.Update

I use gambas method to retrive the image file from database and load onto  
ImageViewer.
     Dim res As Result
     Dim tempFile As String
     Dim hFile As Blob

     res = $newCon.Exec("select fldpic from tblimage")
     res.MoveFirst
     tempFile = Temp() & ".png"
     hFile = res["fldpic"]
     File.Save(tempFile, hFile.Data)
     ImageView1.Image = Image.Load(tempFile)

The above methods (inserting image and retriving image) work properly with  
mysql and sqlite3.
However with PostgreSQL 9.3
-insert image works well. I checked with other application (eg PostgreSQL  
module of Webmin)
-retriving image is not working.


Attachments:
	imagedatabase.tar.gz  5.1 KB

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings




More information about the User mailing list