Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Jpeg error #53
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 16th October 23:00
marcio dalmolin
External User
 
Posts: 1
Default Jpeg error #53


Please, does anybody know how to solve this error ? I'm trying to load a
jpeg image from Oracle table 8i.

procedure TForm1.Button1Click(Sender: TObject);
var
MemStrm: TMemoryStream;
Jpg: TJPEGImage;
begin
If Table1Foto.IsNull then
begin
Image1.Picture.Assign(nil);
Abort;
end;
Jpg:=TJPEGImage.Create;
try
MemStrm:=TMemoryStream.Create;
try
Table1Foto.SaveToStream(MemStrm);
MemStrm.Seek(0,soFromBeginning);
with Jpg do
begin
PixelFormat:=jf24Bit;
Scale:=jsEighth;
GrayScale:=False;
Performance:=jpBestQuality;
ProgressiveDisplay:=True;
ProgressiveEncoding:=True;
LoadFromStream(MemStrm);
end;
Image1.Picture.Assign(Jpg);
finally
MemStrm.Free;
end;
finally
Jpg.Free;
end;
end;


When I execute, I always get error message 'Jpeg error #53'. How do I
resolve it ?

Thanks for your time.

Regards,

Marcio Dalmolin
  Reply With Quote


  sponsored links


2 16th October 23:00
dennis passmore
External User
 
Posts: 1
Default Jpeg error #53


Usally this is a simple out of memory error caused by a invalid jpeg image. In your case since you
are trying to save it from a table read from a Oracle table i would think that the problem is in
your Table1Foto.SaveToStream(MemStrm); code since you do not specify the field name but are
atempting to save the whole table to the stream which ends up not being a valid jpeg image.

Dennis Passmore

"Think it might be a new experience and
if you can not Pull then at least Push
the job will get done"
  Reply With Quote
3 16th October 23:00
igor raskin
External User
 
Posts: 1
Default Jpeg error #53


Try saving the content of MemStrm to file and see if that file is a valid
jpeg.

Igor
  Reply With Quote
4 20th October 14:26
igor raskin
External User
 
Posts: 1
Default Jpeg error #53


Table1 is his dataset, Foto is the field.

Igor
  Reply With Quote
5 20th October 14:26
warrick wilson
External User
 
Posts: 1
Default Jpeg error #53


I think I got this error ages ago and it turned out that the JPEG was saved
as a CMYK format. The jpeg.pas that ships with Delphi 7 can't handle that
format. There's a jpegex.pas available on CodeCentral or BDN (the provider's
name escapes me) that handles the format and solved my problem.

If you can get the image, you might look at it in IrfanView or some graphics
package that can tell you something about the format.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666