sDac 4.30.0.12 and jpeg images

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ccmcbride
Posts: 101
Joined: Tue 01 May 2007 16:36

sDac 4.30.0.12 and jpeg images

Post by ccmcbride » Wed 10 Oct 2007 19:45

I am trying to load/display jpg images (since this is existing data at many sites, and the graphic formats are in jpg), but can’t display them, once the dataset is closed.

Since the standard dbimage component does not work with jpg (at least I can’t make it work), I can't recreate for testing without using devexpress components, which loads it and displays it up until the table is closed and re-opened.


Any ideas?
Last edited by ccmcbride on Thu 11 Oct 2007 17:10, edited 1 time in total.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 11 Oct 2007 12:29

Please refer to these topics on MyDAC forum discussing the problem with displaying jpg images: 1, 2.

ccmcbride
Posts: 101
Joined: Tue 01 May 2007 16:36

Post by ccmcbride » Thu 11 Oct 2007 17:09

I have implemented the code that loads it to the database, and displays to a timage when scrolling.
It works fine, until I close and re-open the table.
Once I close and reopen, I get a jpeg error #51.
My code :
procedure TForm1.ShowBlob;
var
jpg : TJpegImage;
blob : Tblobfield;
begin
blob := tBlobField(tblDataPHOTO);
if blob.BlobSize > 0 then
begin
jpg:= TJpegImage.Create;
jpg.Assign(blob); ---------> jpeg error #51
image1.Picture.Graphic := jpg;
jpg.Free;
jpg := nil;
end //of showing blob
else
image1.Picture.Graphic := nil; // no picture - clear the Timage
end;

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 12 Oct 2007 07:14

It is likely that the BLOB value you load is not a jpg image. I tested your code with valid jpg images, and it works fine.

ccmcbride
Posts: 101
Joined: Tue 01 May 2007 16:36

Post by ccmcbride » Mon 22 Oct 2007 16:58

Same data.
Same photo.
Different database backends (other is dbisam).
No issues.

I've tried different jpeg files. I can't get it to reload, once the table has been closed and reopened.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 23 Oct 2007 06:59

I could not reproduce the problem.
Please send me a complete small sample at sdac*crlab*com to demonstrate it, including a jpeg image and script to create the table.

Also supply me the following information:
- exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- exact version of your IDE;
- exact version of SQL Server and client. You can see it in the Info sheet of TMSConnection Editor.

Post Reply