[GRASS-dev] small bug in i.ortho.photo/photo.rectify
rez at touchofmadness.com
Wed Dec 12 16:58:43 EST 2007
Fix committed to SVN (temp_fd = NULL).
On Wed, 2007-12-12 at 22:17 +0100, hermann schwaerzler wrote:
> recently I orthorectified some photos using i.ortho.photo. the source
> images are true-colour thus I had three "sub-images" in the
> imegary-group. in the final step I selected all three to rectify them.
> after the rectification of the first image the following error occurred:
> "ERROR: error while writing to temp file: No such file or directory"
> and the second and third images were not rectified.
> checking out the cvs-version I found the corresponding bug in
> in function "write_map" (line 63) the temp file-descriptor gets closed
> but not "uninitialized". thus for the second image the check in
> "write_matrix" line 15 finds a non-zero temp_fd which is connected to a
> closed and deleted file. the reuse of this file-descriptor causes the error.
> I solved this problem using the following patch:
> --- grass6/imagery/i.ortho.photo/photo.rectify/write.c.orig
> +++ grass6/imagery/i.ortho.photo/photo.rectify/write.c
> @@ -60,7 +60,7 @@
> - close(temp_fd);
> + close(temp_fd); temp_fd = 0;
> it sets the file-descriptor to 0 after closing it in order to make the
> check in line 15 work for any following iterations. probably not the
> best solution as 0 is a valid value for a file-descriptor (normally
> stdin iirc)?
73, de Brad KB8UYR/6 <rez touchofmadness com>
More information about the grass-dev