#236 closed defect (duplicate)
psImageWriteSection and image sizes
| Reported by: | Paul Price | Owned by: | Paul Price |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | imageops | Version: | 0.3.0 |
| Severity: | minor | Keywords: | |
| Cc: | Eric.VanAlst@… |
Description
In the event that the FITS file exists, psImageWriteSection in rel3 does not
compare the NAXIS[12] and numCols,numRows of the psImage to ensure that they agree.
For example, I had created a 512x512 FITS file by running my program once, then
altered the setup so that it was supposed to write a larger image, 1024x1024,
but the file was consistently 512x512 because it already existed at that size.
Attachments (1)
Change History (12)
comment:1 by , 22 years ago
| Owner: | changed from to |
|---|
comment:2 by , 22 years ago
| Status: | new → assigned |
|---|
I think the condition indicates that something unexpected has happened, so it
should be an error.
comment:3 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Funciton psFitsUpdateImage checks the region to update versus current image and
will generate error if update is outside original.
comment:4 by , 21 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
I have not tried psFitsUpdateImage, but psFitsWriteImage does not produce an
error when writing to a file that already exists, even if the extant file
contains an image of a different size. In any case, the data is not written,
and no error is generated.
I am attaching code that demonstrates the bug. It creates two images, and
writes them out to the same file name (e.g., simulating a typo in the name). I
would expect one of the two behaviours:
- Not write the image and return an error; or
- Write the image and generate a warning.
The actual behaviour is to not write the image and not tell anyone:
price@mithrandir:/home/mithrandir/price/testing>./psFitsWriteImageBug
Done.
Inspection of the image reveals that all values are +1, corresponding to the
first image, despite writing the second image on top.
comment:5 by , 21 years ago
| Owner: | changed from to |
|---|---|
| Status: | reopened → new |
comment:6 by , 21 years ago
| Owner: | changed from to |
|---|
Executing the write image bug software on release 6 will generate a single fits
file with multiple extensions. The first image will have values of 1 and the
second image will have values of -1. If the test is executed again, two
additional images with corresponding values of 1 and -1 are added to the file.
This is no warning or error message generated. The SDR-14 does not specify what
should be done if such a situation occurs. What should be the appropriate action?
comment:7 by , 21 years ago
| Cc: | added |
|---|---|
| dependson: | → 412 |
| Status: | new → assigned |
This seems to be related to bug 412.
The actual behaviour isn't what I would expect, but we need to think about how
we're going to write extensions and create new extensions.
comment:8 by , 21 years ago
The only open issue here seems to be covered by Bug 412. I would say let's just
close this bug and deal with 412.
-rdd
comment:9 by , 21 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | assigned → closed |
Agreed.
* This bug has been marked as a duplicate of 412 *

This function was depreciated, but the question of what the proper behaviour is
still in question for the new image write function.
If the FITS image is 512x512, as in your example, and an 1024x1024 image is
given to psFitsUpdateImage (see bug #226), should we error, write only 512x512
of the input image, or resize the FITS image size (possibly a very costly
operation)?
-rdd