Incorrect TempDir Parsing Prevents any Stitching.

Bug #679035 reported by bgulko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hugin
Triaged
High
Unassigned

Bug Description

Windows bvuild does not work because of incorrect parsing of temporary file directory.

When the 'stitch now' button is pressed, hugin.exe tries to access a temporary directory in

<Tempdir>\%USERPROFILE%\Local Settings\Temp

for example C:\DOCUME~1\Admin\LOCALS~1\Temp\%USERPROFILE%\Local Settings\Temp

rather than either:

<Tempdir> (C:\DOCUME~1\Admin\LOCALS~1\Temp\)
or
%USERPROFILE%\Local Settings\Temp, (which would expand to C:\Documents and Settings\Admin\Local Settings\Temp )

similarly hugin_stitch_project.exe attempts to access a file

D:\Program Files\Hugin\ImageAlignment\bin\%USERPROFILE%\Local Settings\Temp,

rather than

%USERPROFILE%\Local Settings\Temp.

Of course, these directories do not exist, so the operation fails with errors such as

10:26:25: Failed to create a temporary file name (error 267: the directory name is invalid.)
10:26:25: Could not create temporary file

-- Brad

Revision history for this message
nobody (nobody-users) wrote :

I have the same problem:

make: C:\DOCUME~1\USER\Local^: No such file or directory
make: *** No rule to make target `C:\DOCUME~1\USER\Local^'. Stop.

Revision history for this message
nobody (nobody-users) wrote :

A workaround is using a batch file for starting hugin that sets "temp" temporarily to a path that is correctly parsed eg.g:

set temp=g:\temp\
set tmp=g:\temp\

C:\Programme\Hugin\bin\hugin.exe
pause

Revision history for this message
Gerry Patterson (gpatters) wrote :

From what I can tell, hugin uses wxFileName::CreateTempFileName() to create the temporary project file that is passed to hugin_stitch_project for stitching. Previously, if the file is was created and error was reported, but Hugin still continued forward, calling hugin_stitch_project anyways. This is now fixed (trunk, Rev 4386.)

Note the entry in the Preferences Dialog does not get used for the creation of this file. Instead, the value of the entry is recorded in the makefile and passed onto other executables called by the makefile (nona, enblend, etc). Should this be changed?

As this is a wxWidgets call, my guess is there is a problem with the user's environment settings, or a problem with wxWidgets. A workaround is discussed that overrides the system TMP and TEMP variables, before hugin is called, which makes things work. That would lead me to believe something is up with the defaults for those environment variables on said machines.

- Gerry

Revision history for this message
Bruno Postle (brunopostle) wrote :

Lukas fixed it so the setting is written to the Makefile, this ensures that enblend/enfuse use the correct temp location for cache files.

What hasn't been fixed is that the temporary .pto file that is created for stitching has internal paths set for creating intermediate TIFF files that are deleted later - My understanding is that the location of these TIFF files isn't effected by the tempdir preference setting, but is only effected by the $TEMP environment setting.

Revision history for this message
Gerry Patterson (gpatters) wrote :

Hmm...

What is the desired behaviour?

Is it this:

intermediate files written to the TEMPDIR, sourced from paths described in .pto file
output files written to the output path specified in the dialog, sourced from intermediate files from the TEMPDIR
specific executable temporary files (image cache) written to TEMPDIR

- Gerry

Revision history for this message
Yuv (yuv) wrote :

hi Gerry,

do I understand correctly that everything would be written to TEMPDIR except the output file and, if the checkbox in the Stitcher tab is ticked, the "remapped images"?

Yuv

Revision history for this message
Bruno Postle (brunopostle) wrote :

Yes the existing hugin behaviour is correct regarding the TEMPDIR environment variable, all temporary intermediate files are created in TEMPDIR.

The problem as I understand it is that the hugin Tempdir preference should override this and it doesn't.

This is separate to TEMPDIR being set in the .pto.mk files, this only effects the behaviour of enblend when it runs out of memory, and is set properly as far as I know.

Revision history for this message
rew (r-e-wolff) wrote :

similar or the same as bug # 678632

tags: added: tmpdir windows
tags: added: ignored
rew (r-e-wolff)
Changed in hugin:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.