Page 1 of 1

sDac 4.30.0.12 and jpeg images

Posted: Wed 10 Oct 2007 19:45
by ccmcbride
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?

Posted: Thu 11 Oct 2007 12:29
by Antaeus
Please refer to these topics on MyDAC forum discussing the problem with displaying jpg images: 1, 2.

Posted: Thu 11 Oct 2007 17:09
by ccmcbride
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;

Posted: Fri 12 Oct 2007 07:14
by Antaeus
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.

Posted: Mon 22 Oct 2007 16:58
by ccmcbride
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.

Posted: Tue 23 Oct 2007 06:59
by Antaeus
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.