Picture format for SQLite

I’m trying to save pictures in a SQLite database, they save fine but I can’t get the pictures read when I use another application to read SQLite Databases, it seems the format is not the same, my own app reads them fine, the issue is while using external applications

I can read correctly picturevalues saved with another app but this app can’t read pictures saved with my Xojo app.

Using a Visual Studio app I can save them compatible with other apps in JPG format without problem.

I have tried both:

and rec.PictureColumn(“mypic”) 'defaults to Picture.FormatPNG

Is there any special way to save it for compatibility with other apps ?

Have you tried just saving it to a BLOB column using DatabaseRecord.BlobColumn?

No, but I did this in older applications.

I thought that if PictureValue is able to read the format written by another application then PictureColumn should write the same format, is this not correct ?

It seems reasonable that it would be readable by another non-Xojoo app, but since you noticed it does not trying a BLOB is the next obvious step. It could be that PictureColumn stores the data in a not-quite-standard format, it could be a bug, it could be something else. Without a Feedback case for an engineer to look at it, we are both just guessing.

Save your pictures this way

Safe way to save pictures in a Database

Dave, thanks but saving them this way they are still not compatible with other soft.

I need to be able to open the database with other softs ( like SQLite2009 for sample ) and get the same picture.


rec.BlobColumn(“mypiccol”) = mypic.GetData(Picture.FormatJPEG)

This column can be read at least by 2 other softs and the Xojo app can read it as PictureValue