Article

From:
To:
Marcio dalmolin
Subject:
Re: Jpeg error #53
Newsgroup:
borland.public.delphi.graphics

Re: Jpeg error #53

"Marcio dalmolin" <✉navebrazil.com.br> wrote in message 
news:✉newsgroups.borland.com...
> 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 ?

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

Igor
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Thu, 19 Sep 2024 16:36:01 UTC
Copyright © 2009-2024
HREF Tools Corp.