Opened 20 years ago
Closed 17 years ago
#729 closed defect (invalid)
psRegionForImage bound switching
| Reported by: | Owned by: | eugene | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
psRegionForImage allows the inputted upper bounds to be smaller than the lower
bounds. (or vice-versa). For example, setting x0 = 10 and x1 = 5 is valid and
this routine simply switches the two values. I don't believe that this type of
behaviour is either safe or consistent throughout region/image functions.
This issue was discussed at our meeting today and the resolution was to create
this bug.
Change History (4)
comment:1 by , 20 years ago
| Owner: | changed from to |
|---|
comment:2 by , 20 years ago
comment:3 by , 20 years ago
well, my thought was simply that an incorrectly specified boundary set such as:
x0 = 10, y0 = 10
x1 = 9, y0 = 11
would be accepted. Another example after adjusting for negative indexing,
x0 = 10, y0 = 10 (max image includes 14, 14)
x1 = -8, y1 = 12
which translates to: x1 = 7, y1 = 12
would also get swapped with the lower boundary. The output of such would be:
x0 = 7, y0 = 10
x1 = 10, y1 = 12
comment:4 by , 17 years ago
| Priority: | high → low |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
I don't see a problem with either of the examples given, and I am inclined to deny this as a bug.

before changing the code, can you give an example where this behavior would
cause a problem, assuming that the upper bounds are first adjusted for the
negative number behavior?