JPEG images in database and clearing BLOB field
Help!
I've got BMP and JPEG images in database... ...and problems with displaying
the last ones. Any suggestions?
Current code doesn't work for JPEG:
try
Image3.Picture.Bitmap.Assign(databasePICTURE);//bmp
except//jpeg
on EInvalidGraphic do Image3.Picture.Graphic:=nil;
end;
if Image3.Picture.Graphic is TJPEGImage then with
TJPEGImage(Image3.Picture.Graphic) do begin
PixelFormat:=TJPegPixelFormat(jf24bit);
Scale:=TJpegScale(jsFullSize);
GrayScale:=False;
Performance:=TJpegPerformance(jpBestQuality);
ProgressiveDisplay:=True;
end;
And another strange problem:
When I clear BLOB field (I'm using InterBase... ...if this helps) using
following statements:
database.Edit;
databasePICTURE.Clear;
database.Post;
is everything allright except size of database (.gdb file) doesn't reduce.
That means some garbage stays in. How to get rid of that "lost" segments.
Should I replace databasePICTURE.Clear with something else?
Thanks, Luka.