JPEG Error in Delphi 6

i have a jpeg image which can be viewed in Internet Explorer 6....but, when i load it from Delphi 6 via JPEG unit ...it tell me the error of "JPEG error #52"

 Jpeg:=TJpegimage.Create;
  try
    Jpeg.LoadFromFile(edimagefile.text);
  finally
    Jpeg.Free;
  end;

is there anyway i can fix it ?

thanks
chongkeng_woonAsked:
Who is Participating?
 
Wim ten BrinkSelf-employed developerCommented:
It could be a JPEG2000 image. There are new formats of the JPEG file format, including one that supports lossless compression. The JPEG unit is just a bit outdated...
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
the jpeg error #52 says that it is not a jpeg file (bad file format)...
are you sure about the format of the image?
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
BTW just in addition take a look here
http://community.borland.com/article/0,1410,20433,00.html
there's code for jpeg errors translation
error #52 = Not a JPEG file: starts with 0x%02x 0x%02x
Check for the format of your image....it seems that it's saved with jpg extension but the header isn't correct
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.