DbPic=New DatabaseRecord
DbPic.IntegerColumn(“cntid”)=Val(TxtOrderNum.Text)
DbPic.Column(“foto”) =PictureToString(droppicture)
f = SpecialFolder.Temporary.Child(“Temp_Image.jpg”)
''f.saveAsJPEG p
droppicture.Save(f,Picture.SaveAsJPEG ,-1)
bs=BinaryStream.Open(f,False)
If bs <> NIL then
imageData = bs.read(bs.length )
bs.close
DbPic.BlobColumn(“foto”) = EncodeHex(imageData)
End if
how I can compress more the picture to a smaller size to store the data on the Postgresql database
JPG pictures are already compressed. You probably won’t gain much by compressing them again.
Encoding binary data as hex will double the size of the data, in which case compression will probably be useful. But I don’t see why it needs to hex encoded at all.
DbPic=New DatabaseRecord
DbPic.IntegerColumn(“cntid”)=Val(TxtOrderNum.Text)
DbPic.Column(“foto”) =PictureToString(droppicture)
f = SpecialFolder.Temporary.Child(“Temp_Image.jpg”)
''f.saveAsJPEG p
droppicture.Save(f,Picture.SaveAsJPEG ,-1)
bs=BinaryStream.Open(f,False)
If bs <> NIL then
imageData = bs.read(bs.length )
bs.close
DbPic.BlobColumn(“foto”) = EncodeHex(imageData)
End if
how I can compress more the picture to a smaller size to store the data on the Postgresql database[/quote]
does it matter if its lossy vs lossless ?
lossless - use PNG
lossy - use JPEG