bugOpenEXR - Bugs: bug #8533, Header::sanityCheck comments are...

 
 

bug #8533: Header::sanityCheck comments are inconsistent with the code

Submitted by:  None
Submitted on:  Sat 10 Apr 2004 09:45:17 PM UTC  
 
Category: IlmImfSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Florian Kainz <fkainz>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 22 Feb 2005 11:14:04 PM UTC, comment #1:

1) In this case, the comments are consistent with the code.
A window with min == max contains one pixel, not zero.

2) The comment has been changed to "must not be less than 0".
The code has not been changed to "screenWindowWidth <= 0",
because the test is unreliable: Some machines support
denormalized numbers that are greater than zero; on other
machines denormalized numbers are flushed to zero.

Florian Kainz <fkainz>
Project MemberIn charge of this item.
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.");

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 22 Feb 2005 11:14:04 PM UTCfkainzStatusNone=>Fixed
  Assigned toNone=>fkainz
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1