Panorama stitching fails if path contains parentheses

Bug #709361 reported by Ben Lincoln

This bug report was converted into a question: question #164377: Panorama stitching fails if path contains parentheses.

108
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Hugin
Invalid
Undecided
Unassigned

Bug Description

Sorry if this has already been reported, but I couldn't find it in the list of bugs or the FAQ.

The new Hugin is a huge improvement overall, but if I try stitching a panorama whose files are in a location whose path contains an open-parenthesis character, the stitching fails. Here is the error log generated:

===========================================================================
*************** Panorama makefile generated by Hugin ***************
===========================================================================
System information
===========================================================================
Operating System: Windows 7 (6.1 )
Architecture: x86
Number of logical processors: 8
Physical memory: 12581304 kiB (38% occupied)
Free space on disc: 894195 MiB
Active codepage: 1252 (Western European Windows)
===========================================================================
Output options
===========================================================================
Hugin Version: 2010.4.0.854952d82c8f built by Matthew Petroff
Project file: C:\Users\blincoln\AppData\Local\Temp\hug18BE.tmp
Output prefix: Panorama
Projection: Equirectangular (2)
Field of view: 98 x 66
Canvas dimensions: 4140 x 2788
Crop area: (0,0) - (4140,2788)
Output exposure value: 5.00
Selected outputs
Normal panorama
* Blended panorama
===========================================================================
Input images
===========================================================================
Number of images in project file: 4
Number of active images: 4
Image 0: V:\Drive 2010 Photos\Day_11-2010-07-15\08-Apollo (14QM) Module Panorama\DSC_9982.TIF
Image 0: Size 3008x2000, Exposure: 5.00
Image 1: V:\Drive 2010 Photos\Day_11-2010-07-15\08-Apollo (14QM) Module Panorama\DSC_9983.TIF
Image 1: Size 3008x2000, Exposure: 5.00
Image 2: V:\Drive 2010 Photos\Day_11-2010-07-15\08-Apollo (14QM) Module Panorama\DSC_9984.TIF
Image 2: Size 3008x2000, Exposure: 5.00
Image 3: V:\Drive 2010 Photos\Day_11-2010-07-15\08-Apollo (14QM) Module Panorama\DSC_9985.TIF
Image 3: Size 3008x2000, Exposure: 5.00
===========================================================================
Testing programs
===========================================================================
Checking nona...
nona is ok
Checking enblend...
enblend is ok
Checking enfuse...
enfuse is ok
Checking hugin_hdrmerge...
hugin_hdrmerge is ok
Checking exiftool...
exiftool is ok
===========================================================================
Stitching panorama
===========================================================================
make: *** No rule to make target `14QM) Module Panorama/DSC_9982.TIF)', needed by `Panorama0000.tif'. Stop.

Revision history for this message
tmodes (tmodes) wrote :

I can not reproduce the bug. It works here okay, also with parentheses in the path.
Could you provide the pto and .pto.mk file?

Could you please try also:
1.) Start stitching
2.) If error occur, leave the message box open.
3.) Go to your temp order (C:\Users\blincoln\AppData\Local\Temp). There should be several files hug????.tmp Please attach also the youngest file (look at the modification date of the files). (The content of this file should look similiar to the .pto.mk file)

Yuv (yuv)
Changed in hugin:
status: New → Incomplete
Revision history for this message
PONCEY Laurent (pub-poncey) wrote :

Hi !
I have the same problem.
It seems to be because of a "(" in the names of my images ; may also because of a " " followed by a "(".
I attach the files you asked.
Thanks a lot.
Best regards,

Laurent Poncey

Yuv (yuv)
Changed in hugin:
status: Incomplete → New
Revision history for this message
Florian Achleitner (fachleitner) wrote :

Hello!

Does this only happen on Windows with make 3.82?
But never with 3.81?
It seems something changed with Quoting/Escaping of parenthesis.
Parenthesis are used in makefiles to specify archive members [1] and the release notes say they fixed a bug in this area [2].

A quick workaround for those affected by the problem will be renaming your files, without parenthesis.

[1] http://www.gnu.org/software/make/manual/html_node/Archive-Members.html#Archive-Members
[2] http://savannah.gnu.org/bugs/?18435

Revision history for this message
Florian Achleitner (fachleitner) wrote :

Update:

I reproduced it on ubuntu 10.10 with make 3.82, the pto file from bug.zip, a makefile by pto2mk, pictures by ptodummy.

$ ../make-3.82/make -f techendorf.linux.pto.mk
===========================================================================
Stitching panorama
===========================================================================
make: *** No rule to make target `19h19-05) - Techendorf.pto)', needed
by `out_0000.tif'. Stop.

make 3.81 runs great. So I guess it's a bug in make 3.82. It somehow scrambles the letters to produce this filename (buffer overflow?). Note that the pto-file should never be a target to be remade.
Of course there is no rule defined for that file (run with -d to see make searching for a rule), so the error message itself is correct.

Then I tried to track it with valgrind. The error did not occur if running under valgrind! And even now i can't reproduce it any more (I deleted the created files every time of course).
This behaviour also looks like a memory problem in make.

Revision history for this message
Nick (nrichards) wrote :

I'm seeing a related "(" issue when I click "3. Create panorama..." a shell-script barf on the Operating System name having an open parentheses in it:

LOG:

===========================================================================
2011-04-12 10.02.49.jpg 2011-04-12 10.03.45.jpg 2011-04-12 10.06.27.jpg 2011-04-12 10.06.37.jpg 2011-04-12 10.06.48.jpg 2011-04-12 10.07.09.jpg 2011-04-12 10.07.52.jpg Thumbs.db Panorama makefile generated by Hugin 2011-04-12 10.02.49.jpg 2011-04-12 10.03.45.jpg 2011-04-12 10.06.27.jpg 2011-04-12 10.06.37.jpg 2011-04-12 10.06.48.jpg 2011-04-12 10.07.09.jpg 2011-04-12 10.07.52.jpg Thumbs.db
===========================================================================
System information
===========================================================================
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `echo Operating System: Windows XP (5.1 Service Pack 3)'
make: *** [info] Error 2

END LOG.

Needs some back-slashification someplace..?

Revision history for this message
Nick (nrichards) wrote :

So, to restate the problem, the issue is with MAKE parsing @echo lines having ('s, for me:

info :
 @echo ===========================================================================
 @echo *************** Panorama makefile generated by Hugin ***************
 @echo ===========================================================================
 @echo System information
 @echo ===========================================================================
 @echo Operating System: Windows XP (5.1 Service Pack 3)
 @echo Architecture: x86
 @echo Number of logical processors: 4
 @echo Physical memory: 3406828 kiB (76%% occupied)
 @echo Free space on disc: 126007 MiB
 @echo Active codepage: 1252 (Western European Windows)
 @echo ===========================================================================
 @echo Output options
 @echo ===========================================================================
 @echo Hugin Version: 2010.4.0.854952d82c8f built by Matthew Petroff
....

If I rerun the make command by hand (I intercepted it with a "make.bat" that outputs the input args) and modify the TMP makefile to delete the @echo commands, I can complete the Panorama gen. I do run into an error @ "clean" but that's minor compared to not being able to gen the pano.

... (minor error seen after removing the @echo's) ...
===========================================================================
Remove temporary files
===========================================================================
del "2011-04-12 10.06.37-2011-04-12 10.070000.tif" "2011-04-12 10.06.37-2011-04-12 10.070001.tif" "2011-04-12 10.06.37-2011-04-12 10.070002.tif"
/usr/bin/sh: del: command not found
make: [clean] Error 127 (ignored)
...

Still looking for an alternative or flag to MAKE I can pass which'll accept illegal characters on the @echo. It'd be better to munge the @echo line, however, to escape all the illegals. Simple quoting may run into an un-quoting input arg which'd break the make command, again.

Revision history for this message
tmodes (tmodes) wrote :

@Nick: Your problem has nothing to do with the parenthesis in filename. This is an issue with make 3.82

Your problem results from a unix like shell somewhere in your path. This is already covered by the FAQ: http://wiki.panotools.org/Hugin_FAQ#Stitching_fails_on_Windows_.28syntax_error.29
There are already several bug reports concerning your problem:
https://bugs.launchpad.net/hugin/+bug/696646
https://bugs.launchpad.net/hugin/+bug/727406
This bug is already fixed in the upcoming version.

Yuv (yuv)
Changed in hugin:
status: New → Fix Committed
Revision history for this message
tmodes (tmodes) wrote :

@Yuv: The original bug is not fixed. This is probably a bug inside gnu make 3.82 (make 3.81 works).
Then Nick hijacked this bug report with a unrelated bug, only this unrelated bug is fixed. Therefore setting the status to open again.

Changed in hugin:
status: Fix Committed → Confirmed
Revision history for this message
Yuv (yuv) wrote : Re: [Bug 709361] Re: Panorama stitching fails if path contains parentheses

On May 1, 2011 04:11:11 AM tmodes wrote:
> @Yuv: The original bug is not fixed. This is probably a bug inside gnu make
> 3.82 (make 3.81 works). Then Nick hijacked this bug report with a
> unrelated bug, only this unrelated bug is fixed. Therefore setting the
> status to open again.

thanks for explaining, Thomas. I am trying to catch up with the bug reports
after four weeks of no time to follow them and misunderstood your last note
after skimming over much of the previous thread.

Revision history for this message
Ina (inute-ina) wrote :

===========================================================================
*************** Panorama makefile generated by Hugin ***************
===========================================================================
System information
===========================================================================
Operating System: Windows 7 (6.1 )
Architecture: x86
Number of logical processors: 2
Physical memory: 3145016 kiB (42% occupied)
Free space on disc: 54540 MiB
Active codepage: 1257 (Baltic Windows)
===========================================================================
Output options
===========================================================================
Hugin Version: 2010.4.0.854952d82c8f built by Matthew Petroff
Project file: C:\Users\Inute\AppData\Local\Temp\hugE919.tmp
Output prefix: DSCF7881.RAF-DSCF7883
Projection: Rectilinear (0)
Field of view: 179 x 178
Canvas dimensions: 3000 x 1500
Crop area: (0,0) - (3000,1500)
Output exposure value: 12.07
Selected outputs
Normal panorama
* Blended panorama
===========================================================================
Input images
===========================================================================
Number of images in project file: 3
Number of active images: 3
Image 0: D:\Picture\Foto\Ivairios\Vasarai artImage 0: Size 3867x2913, Exposure: 12.07
Image 1: D:\Picture\Foto\Ivairios\Vasarai artImage 1: Size 3867x2913, Exposure: 12.20
Image 2: D:\Picture\Foto\Ivairios\Vasarai artImage 2: Size 3867x2913, Exposure: 9.62
===========================================================================
Testing programs
===========================================================================
Checking nona...
nona is ok
Checking enblend...
enblend is ok
Checking enfuse...
enfuse is ok
Checking hugin_hdrmerge...
hugin_hdrmerge is ok
Checking exiftool...
exiftool is ok
===========================================================================
Stitching panorama
===========================================================================
"C:/Program Files/Hugin/bin/nona" -z LZW -r ldr -m TIFF_m -o "DSCF7881.RAF-DSCF7883" -i 0 "C:/Users/Inute/AppData/Local/Temp/hugE919.tmp"
ContractViolation:
Precondition violation!
Unable to open file 'D:\Picture\Foto\Ivairios\Vasarai art

Revision history for this message
Rich (rpow5152) wrote :

+1
I have successfully worked around this bug for some time now.
However windows default bulk renaming tool introduces parentheses into the filenames, so will continue to catch out new hugin users on the windows platform.
I can confirm that this happens on a wide range of windows builds of Hugin, both 32 and 64 bit versions, and all 2010 and 2011 releases.

Revision history for this message
Sean Aitken (sean-aitken) wrote :

Okay.. so, is there an easy workaround? I spend considerable time setting up the images and getting everything right in Hugin only to have it barf at the stitching stage with this problem. My image filenames have "(Processed)" in them... about 30 or so images.

I use Adobe Camera Raw with it set to append "(Processed)" at the end of my images. It's a hassle to rename files.. and even having to remember to do it is a chore.

Cheers!
-Sean

Revision history for this message
Yuv (yuv) wrote :

This is a Make issue, not a Hugin issue. Not much the Hugin project can do, hence I convert this bug to question and the conversion will mark it as invalid.

Those distributing Hugin for Windows that bundle Make with it will know to bundle a fixed version of Make in the future.

For now, there are a few workarounds:

Workaround #1: start a command line and issue the command `make --version`. if you see an affected version down or upgrade to a non affected Make version. If nothing works, try another workaround.

Workaround #2: don't use parenthesis in your file names form the start. I haven't used ACR in years, but when I did I remember I could fully customize the output name prefixes and suffixes.

Workaround #3: use a batch renaming script to get rid of the parenthesis.

Revision history for this message
Yuv (yuv) wrote :

this is a Make issue, not a Hugin issue. up/downgrade to a version of Make that is not affected.

Changed in hugin:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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