error in select longblob

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
dungabruxo
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 19.05.2009, 13:58

error in select longblob

Post by dungabruxo »

I use Delphi 2010 to save a JPG image into a field LONGBLOB, but after saving in a Mysql the Image is saved only BINARY. When I retrieve the image with "SELECT" error occurs "JPG ERROR # 53". Does anyone know why?

I try this 2 codes to post image is:

1 =
jpg:=TJPEGImage.Create;
jpg.LoadFromFile('fototemporaria.jpg');
b:=TMemoryStream.Create;
jpg.SaveToStream(b);
dataModule1.zqueryprod.ParamByName('foto').SetBlobData(b.Memory,b.Size);
FreeAndNil(jpg);
FreeAndNil(b);

2 =
datamodule1.zqueryProd.ParamByName('foto').LoadFromFile ('fototemporaria.jpg',ftBlob);

and this code to save image is:

jpg:=TJPEGImage.Create;
(datamodule1.zqueryProdprod_foto as TBlobField).SaveToStream(b);
b.Position:=offsetmemorystream;
jpg.LoadFromStream(b);
JPg.SaveToFile(ChangeFileExt('fototemporaria','.jpg'));
(ERROR JPG ERROR #53)


P.S. In Delphi 2006 it worked correctly.

Rodrigo Andrade de Oliveira
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Have a look at the changes in SVN rev. 712 (http://fisheye2.atlassian.com/changelog/zeos/?cs=712)
This patch may solve your problems. It solved all the test suite's problems with delphi 2009+mysql.

Mark
Image
dungabruxo
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 19.05.2009, 13:58

Problem solved

Post by dungabruxo »

the problem has been solved with this units.
thank you.
Post Reply