From: <bru...@us...> - 2007-04-13 23:06:43
|
Revision: 689 http://svn.sourceforge.net/panotools/?rev=689&view=rev Author: brunopostle Date: 2007-04-13 16:06:34 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Fix some bugs in nona-mask, seems to work ok Modified Paths: -------------- trunk/Panotools-Script/Makefile.PL trunk/Panotools-Script/README trunk/Panotools-Script/bin/nona-mask Modified: trunk/Panotools-Script/Makefile.PL =================================================================== --- trunk/Panotools-Script/Makefile.PL 2007-04-13 21:32:47 UTC (rev 688) +++ trunk/Panotools-Script/Makefile.PL 2007-04-13 23:06:34 UTC (rev 689) @@ -3,7 +3,7 @@ # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Panotools::Script', - 'EXE_FILES' => [ 'bin/cubic2erect', 'bin/erect2cubic', 'bin/jpeg2qtvr', 'bin/erect2qtvr', 'bin/enblend-mask', 'bin/process-masks', 'bin/erect2planet', 'bin/pto2tiff', 'bin/transform-pano' ], + 'EXE_FILES' => [ 'bin/cubic2erect', 'bin/erect2cubic', 'bin/jpeg2qtvr', 'bin/erect2qtvr', 'bin/enblend-mask', 'bin/process-masks', 'bin/erect2planet', 'bin/pto2tiff', 'bin/transform-pano', 'bin/nona-mask' ], 'VERSION_FROM' => 'lib/Panotools/Script.pm', # finds $VERSION 'PREREQ_PM' => {'Math::Matrix' => 0.4, 'Image::Magick' => 5.0}, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 Modified: trunk/Panotools-Script/README =================================================================== --- trunk/Panotools-Script/README 2007-04-13 21:32:47 UTC (rev 688) +++ trunk/Panotools-Script/README 2007-04-13 23:06:34 UTC (rev 689) @@ -39,13 +39,10 @@ * Delete control points * error distance * Scale project -* nona-mask tool -* $STITCHER environment * split enblend step from pto2tiff * pto2tiff stitches one file at a time -* jpeg2qtvr calculate window size from fov * erect2qtvr --yaw value -* jpeg2qtvr: calculate window size from fov and cubeface size +* jpeg2qtvr calculate window size from fov and cubeface size Copyright and licence Modified: trunk/Panotools-Script/bin/nona-mask =================================================================== --- trunk/Panotools-Script/bin/nona-mask 2007-04-13 21:32:47 UTC (rev 688) +++ trunk/Panotools-Script/bin/nona-mask 2007-04-13 23:06:34 UTC (rev 689) @@ -19,14 +19,16 @@ my $arg = shift @ARGV; if ($arg =~ /-o/) { - $outfile = shift @ARGV; - $script = shift @ARGV; + $outfile = File::Spec->rel2abs (shift @ARGV); + $script = File::Spec->rel2abs (shift @ARGV); next; } if ($arg =~ /\.[[:alnum:]]+$/i) {push @files, $arg} else {push @parameters, $arg} } +die "Usage: $0 [options] -o output project_file (image files)" unless ($outfile && $script); + my $pano = new Panotools::Script; $pano->Read ($script); @@ -45,8 +47,14 @@ my $tempfile = File::Spec->catfile ($tempdir, "$index.tif"); my $name = $image->{n}; $name =~ s/(^"|"$)//g; - my $mask = $name; - $mask =~ s/\.[[:alnum:]]+$/_mask.tif/i; + my $prefix = $name; + $prefix =~ s/\.[[:alnum:]]+$//i; + + # prefer TIF or SVG versions if they exist + $name = "$prefix.tif" if (-e "$prefix.tif"); + $name = "$prefix.svg" if (-e "$prefix.svg"); + + my $mask = $prefix . '_mask.tif'; if (-e $mask) { print STDERR "Using mask $mask\n"; @@ -59,13 +67,14 @@ system ('convert', '-background', 'transparent', $name, $tempfile); $image->{n} = "\"$tempfile\""; } - $name =~ s/\.jpg$/\.tif/i; - $image->{n} = "\"$name\"" if -e $name; - $name =~ s/\.jpg$/\.svg/i; - $image->{n} = "\"$name\"" if -e $name; + else + { + $image->{n} = "\"$name\""; + } + $index++; } -$pano->Stitch ($outfile); +$pano->Stitch ($outfile, @parameters); __END__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |