Tuesday, October 11, 2011

Wide Pictures and Bad Packages: A Hugin tale

I love my Kodak Z1012. Specifically I love it's in-camera panorama picture auto-stitching feature. I've tried some of the newer cameras' click and sweep panorama picture feature and I am not impressed. The quality is a bit off, like it was a video grab instead of a static picture. Nothing as good as the quality in the picture below which is built from three snaps.
Interesting cloud formation in an afternoon sky
It happened that I was out on a trip and my significant other asked me to stop so that she could take in a nice panoramic view. The road was narrow and downhill, so I stayed in the car while she stood out and took a deep breath. And a few snaps, none of which used the panorama feature. When we got home I realized what had happened and decided this was the opportunity to try out Hugin, a photo stitcher that was featured in Linux Format. There was even a tutorial the for it in the following issue. It is useful as both a straight forward stitcher to create panoramic picture or to create some truly interesting photos. Besides, it had to be good because it was good enough to raise patent violation concerns.
So I started by installing Hugin. Except that the Mandriva Software Manager, powered by urpmi and rpm, said that it couldn't figure out where to get a particular library file. Not the first time this has happened to me, I just copied the name of the file and fed it to rpm.pbone.net, THE place for RPMS. It gave me the name of the Mandriva package and a link where I could download it. I was tempted to click on the file and have Software Manager install it. But I also know that when I do that, it does not check for dependencies. So that would open a whole can of worms.
So I found the same package in Software Manager and installed it that way. I tried installing Hugin again but this time it flat out refused. It didn't complain about the missing library. It just said that it can't install. I was getting annoyed but quickly realized that there was a way. The old-fashioned way.
Rpm.pbone.net has a feature that can check for missing files that are required by a package. It does require enabling Javascript. What it does is that it just looks for them on your hard disk. If it can't find it on your disk, rpm.pbone.net will provide a link to the package that offers the file. Nice.
So I settled on the following process.
  1. Select a file that rpm.pbone.net says hugin needs but I don't have.
  2. Click on the filename to search for that package that has it 
  3. Find the package in Software Manager and install it. 
  4. Re-run the check for missing required files
  5. Go to 1. if there are any missing files.
I like to work according to a process. Sure, I could bulldoze thru and install hugin from the console and fix each errors that pops up. Or worse still, build from source. Been there done, done that. But running through a process like the above gives my head enough space to look at my work for flaws and deal with them. It also gives me a way to backtrack in case I do something wrong. 
Well, I did found something strange. Some of the files the package requires are provided by the package itself. That is, if I click on that missing file, it would say that I need hugin installed for hugin to install. Talk about circular reasoning. It seems that whoever packaged Hugin for Mandriva, got their RPM pre-packaging info files wrong. Another tell-tale sign that the packager messed up is that the Hugin package also requires /bin/sh. Seen that before on other bad packages. Smelled like a bad cut and paste job.
After installing all the of the files rpm.pbone.net found through SoftwareManager, I downloaded hugin from rpm.pbone.net and installed it (Software Manager/urpmi auto adding --no-deps).
It worked like a charm. Hugin, that is. I'm still fiddling with it to come out with a good picture. It works like a charm but has a KDE-esque number of configuration options.
Now where is that tutorial?

No comments:

Post a Comment

Recently Popular