Re: Trapping errors in QUERY_IMAGE [message #61856] |
Thu, 07 August 2008 09:19 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
M. Katz writes:
> I'm working to add error trapping to my input/output code and I've run
> into a problem. The IDL routine QUERY_IMAGE() will crash if the image
> exists, has a valid type, but there's something wrong with the file.
> In my case, I have a bad PNG file that I'm using as a test case.
>
> QUERY_IMAGE() breaks with a message saying
> QUERY_PNG: libpng error: Read Error
>
> My goal is to trap that error. Placing an ON_IOERROR into IDL's
> QUERY_IMAGE() (and removing the ON_ERROR, 2) doesn't seem to work
> because the error happens within QUERY_PNG() which may not be written
> in IDL.
>
> Any advice as to how to add more robustness to my error trap in this
> case?
It can be a problem. Maybe you can get some ideas from
this article:
http://www.dfanning.com/fileio_tips/nohdf.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|