Sat 10 Apr 2004 09:45:17 PM UTC, original submission:
Two comments about the checks made in Header::sanityCheck are inconsistent with the code.
1) A box with a size of 0 will pass the test, no throwing an exception :
//
// The display window and the data window
// must contain at least one pixel each.
//
const Box2i &displayWindow = this->displayWindow();
if (displayWindow.min.x > displayWindow.max.x ||
displayWindow.min.y > displayWindow.max.y)
throw Iex::ArgExc ("Invalid display window in image header.");
const Box2i &dataWindow = this->dataWindow();
if (dataWindow.min.x > dataWindow.max.x ||
dataWindow.min.y > dataWindow.max.y)
throw Iex::ArgExc ("Invalid data window in image header.");
2) A screen window width of 0 will pass the test, not throwing an exception :
//
// The screen window width must be greater than 0.
// The size of the screen window can vary over a wide
// range (fish-eye lens to astronomical telescope),
// so we can't limit the screen window width to some
// range like the pixel aspect ratio.
//
float screenWindowWidth = this->screenWindowWidth();
if (screenWindowWidth < 0)
throw Iex::ArgExc ("Invalid screen window width in image header.");
|