Install Panotools-Script on Windows

From PanoTools.org Wiki
Revision as of 00:42, 20 February 2008 by Bruno (Talk | contribs)

Jump to: navigation, search

Panotools::Script is a framework for scripting various panorama operations using the command-line tools shipped with hugin, it has some Documentation on CPAN.

Perl

Panotools::Script is a Perl module, so for Windows you need to download and install ActiveState Perl first, I got the MSI installer for ActivePerl-5.8.8.822.

For some reason, the installer doesn't set the PATH correctly for manually built modules, so go to Explorer -> My Computer -> right-click -> Properties -> Advanced -> Environment Variables -> System variables. Scroll to Path, click edit, and add this path to the front of the existing list of paths:

 C:\Perl\site\bin; 

Math::Matrix, Image::Size and Module::Build

You need three extra modules that are not installed by default. So in the Activestate part of the Start menu, run the Perl Package Manager (PPM). This can be used to install pre-built add-on modules, in this case you want to install Math-Matrix, Image-Size and Module-Build. Reboot after installing Module-Build, remember this is windows.

ImageMagick

ImageMagick is a general purpose command-line image manipulation suite, Panotools::Script uses it for various purposes such as resizing and playing with alpha channels. I downloaded the Win32 dynamic at 16 bits-per-pixel version from the ImageMagick site.

hugin

Install hugin from the sourceforge download area if you haven't already. You need to fix the PATH again, add the hugin installation location the same as you did for Perl above:

 C:\Program Files\hugin\bin;

autotrace

Autotrace is a tool for converting bitmap images to vector graphics, only install this if you plan on editing enblend masks in Inkscape.

Download autotrace from here. You need to manually extract and install this one, put the folder containing the various DLLs and EXE files somewhere like C:\Program Files\autotrace and add this to your PATH as you did for Perl and hugin.

Panotools::Script

Download the latest source-code for Panotools::Script. This is a gzipped tar archive, so you will need something like 7-zip to extract it.

Download nmake

make is required to build and install Perl modules, download nmake from Microsoft and double-click it to extract. Copy NMAKE.EXE and NMAKE.ERR to the directory where you extracted the Panotools::Script sources.

Test and install

Open a command window: Click Start -> Run... -> cmd -> OK.

Change to the directory where you extracted the sources:

 cd Desktop\Panotools-Script-0.09

Then run the tests:

 perl Makefile.PL
 nmake test

The tests will produce lots of output and warnings, but at the end it should report 100% success. Finally install everything:

 nmake install

Creating .exe tools

This step isn't necessary if you have perl installed, but may be useful to make the tools usable on systems without perl. The right tool for this is PAR::Packer, I couldn't get it to work with this version of perl (please update this HOWTO if you know), so I installed App-Packer using Perl Package Manager (PPM).

If you are lucky then you can just create the .exe files with the make_exe.pl script:

 perl make_exe.pl

I wasn't so lucky and had an error from a standard perl module bytes_heavy.pl, which I fixed by pasting this code into C:\Perl\lib\bytes_heavy.pl

<source lang="pl"> sub import {

   return unless $Have_Bytes;
   shift;
   unshift @_, 'bytes';
   goto &bytes::import;

} </source>

Finally, you should be able to run the resulting .exe files on other Windows systems, though you will also need the copy the perl58.dll file to the same destination.