Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Databases
»
[SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob]
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Local AI LLM Wrapper Demo...
by
edwinyzh
[
Today
at 05:30:15 am]
Trndi 16 is released
by
slicke
[
Today
at 03:06:44 am]
Clean up and build
by
n7800
[August 14, 2026, 11:03:28 pm]
[Qt5/Qt6] JPSupport-Qt: J...
by
Martin_fr
[August 14, 2026, 09:30:43 pm]
var vs out (including "co...
by
440bx
[August 14, 2026, 09:25:21 pm]
FpDebug: Bugs and API gap...
by
Martin_fr
[August 14, 2026, 09:19:49 pm]
Which Linux version
by
cdbc
[August 14, 2026, 08:57:51 pm]
'ReadStr' ?
by
PascalDragon
[August 14, 2026, 08:33:34 pm]
Cross platform DirectoryW...
by
LemonParty
[August 14, 2026, 07:41:15 pm]
Lazarus Bugfix Release 4....
by
wp
[August 14, 2026, 04:47:58 pm]
LRS Explorer
by
wp
[August 14, 2026, 04:02:45 pm]
TDWEdit
by
docno
[August 14, 2026, 03:35:02 pm]
BS Controls – Silly Compo...
by
Xenno
[August 14, 2026, 02:30:43 pm]
Separators in the compone...
by
JuhaManninen
[August 14, 2026, 01:28:05 pm]
Lazarus, Ubuntu Pi 4 and ...
by
Thaddy
[August 14, 2026, 12:07:04 pm]
Unleashed Pascal (async/a...
by
creaothceann
[August 14, 2026, 11:11:47 am]
AsyncProcess not firing O...
by
Martin_fr
[August 14, 2026, 11:05:52 am]
Is it possible to communi...
by
Xor-el
[August 14, 2026, 10:28:59 am]
How to avoid duplicates i...
by
mig-31
[August 13, 2026, 05:35:46 pm]
QGradientTrackPanel: A Fu...
by
Ed78z
[August 13, 2026, 04:49:24 pm]
Memory location
by
Thaddy
[August 13, 2026, 04:01:56 pm]
TurboBird IBX
by
laguna
[August 13, 2026, 03:55:51 pm]
TlsLib4Pascal
by
Xor-el
[August 13, 2026, 03:06:13 pm]
MR - DebuggerIntf for ter...
by
Martin_fr
[August 13, 2026, 12:54:22 pm]
AArch64, load a constant ...
by
LemonParty
[August 13, 2026, 12:31:06 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob] (Read 2200 times)
heejit
Sr. Member
Posts: 251
[SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob]
«
on:
March 19, 2019, 05:48:21 pm »
Code: Pascal
[Select]
[+]
[-]
Working
:
astream
:
TStream
astream
:
=
m_qry
.
CreateBlobStream
(
m_qry
.
FieldByName
(
'file_data'
)
,
bmRead
)
;
self
.
imgWidget
.
Picture
.
LoadFromStream
(
astream
)
;
Not
Working
:
Unknown Picture Format
astream
:
TMemoryStream
TBlobField
(
self
.
m_qry
.
FieldByName
(
'file_data'
)
)
.
SaveToStream
(
astream
)
;
self
.
imgWidget
.
Picture
.
LoadFromStream
(
astream
)
;
In documentation also it suggested to use TBlobField :
https://www.freepascal.org/docs-html/fcl/db/tdataset.createblobstream.html
Then why there is format Error?
Development Env:
Lazarus : 2.0
Feepascal : 3.0.4
SVN Rev : 60350M
OS : Linux 64bit Ubuntu 16.04
«
Last Edit: March 31, 2019, 03:10:00 pm by jshah
»
Logged
heejit
Sr. Member
Posts: 251
Re: Read Picture from Postgresql Database Unknown Picture Format [blob, postgresql]
«
Reply #1 on:
March 31, 2019, 03:09:37 pm »
Solved
We need to move the position of stream to beginning
astream.Position:=0;
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Databases
»
[SOLVED] Read Picture from Postgresql Database Unknown Picture Format [blob]
TinyPortal
© 2005-2018