comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Trapping errors in QUERY_IMAGE
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Trapping errors in QUERY_IMAGE [message #61856] Thu, 07 August 2008 09:19
David Fanning is currently offline  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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Trapping errors in QUERY_IMAGE
Next Topic: Price of ION

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:41:50 PDT 2025

Total time taken to generate the page: 0.00572 seconds