Link to home
Start Free TrialLog in
Avatar of andrewyu
andrewyu

asked on

JPEG

How can I verify a JPEG file is valid or not ? Because it will halt if I pass a file name of invalid JPEG file to LoadFromFile, so, how can I prevent it halt again !

Andrew
Avatar of v_pasupuleti
v_pasupuleti

Hi Andrew
Use a try exception in ur code.Put ur Loadfromfile in the try block and a default jpg image in the exception block

Vijay
ASKER CERTIFIED SOLUTION
Avatar of EmmDieh
EmmDieh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andrewyu

ASKER

I understand, but, actually I want to know whether Delphi will raise a exception for a "BUG" JPEG file ?

Andrew
use      with jpgimage     try jpgxx.loadfromfil...

bryan
what kind of bugs ?

bryan
I meant a worong content of JPEG file !

Andrew