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
error in select longblob
Moderators: gto, cipto_kh, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
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
This patch may solve your problems. It solved all the test suite's problems with delphi 2009+mysql.
Mark
-
- Fresh Boarder
- Posts: 3
- Joined: 19.05.2009, 13:58
Problem solved
the problem has been solved with this units.
thank you.
thank you.