Page 1 of 1

error in select longblob

Posted: 08.10.2009, 14:16
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

Posted: 09.10.2009, 21:17
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

Problem solved

Posted: 13.10.2009, 13:00
by dungabruxo
the problem has been solved with this units.
thank you.