[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Openexr-devel] partial image
From: |
Florian Kainz |
Subject: |
Re: [Openexr-devel] partial image |
Date: |
Thu, 22 Apr 2004 10:23:38 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314 |
Ken McGaugh wrote:
Hey all, does anybody have any suggestions how to
tell if an exr is incomplete without loading the
whole thing?
It would be easy to check the lineOffsets list, but
it is buried deep in a private data member.
Would there be much of a performance hit to try and
read just the last scanline and see if an exception
is thrown?
Thanks.
--Ken
Trying to read the last scan line (bottom for INCREASING_Y, top for
DECREASING_Y) might be the fastest way to tell if a file is complete.
Missing scan lines are detected early during a readPixels() call; the
lineOffsets table is checked before any data are read from the file.
If the scan line is missing, an Iex::InputExc exception is thrown.
With some operating systems, for example, Irix, processing the first
exception thrown by a particular process can be fairly slow because
it requires loading additional information from the executable file,
but after that, exception handling tends to be fast.
Florian