Bug 280736 - Wrong check for cpfind when using panorama tool
Summary: Wrong check for cpfind when using panorama tool
Status: RESOLVED UPSTREAM
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-Panorama (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 21:02 UTC by Martin Klapetek
Modified: 2016-07-10 05:33 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.1.0


Attachments
Panorama Patch for Faulty Hugin Package (2.58 KB, patch)
2011-09-12 20:49 UTC, Benjamin Girault
Details
New patch for Hugin's ZThreads (1.51 KB, patch)
2011-09-13 17:56 UTC, Benjamin Girault
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Klapetek 2011-08-24 21:02:20 UTC
Version:           unspecified (using Devel) 
OS:                Linux

I'm using latest digiKam from git repo and currently it fails to correctly detect version of 'cpfind' executable when trying to use panorama tool.

I assume it's executing 'cpfind --help' and trying to parse the first line, however kubuntu's hugin version does not have version number on the first line, but 'ThreadQueue created', therefore the check should be somewhat smarter.

Here's a digiKam's output:

digikam(4635)/KIPI (general) KIPIPanoramaPlugin::CPFindBinary::checkSystem: "cpfind"  help header line: 
 "ThreadQueue created"


And here's 'cpfind --version' output:
ThreadQueue created
Hugins cpfind 2010.4.0.854952d82c8f
based on Pan-o-matic by Anael Orlinski
...



Reproducible: Didn't try

Steps to Reproduce:
1. Try running panorama tool on kubuntu

Actual Results:  
DigiKam can't determine cpfind version correctly.

Expected Results:  
DigiKam parses the version correctly.
Comment 1 Benjamin Girault 2011-08-24 21:32:30 UTC
Do you have ZThread installed? The message "ThreadQueue created" looks like a debug message from ZThread. Looks like ZThread is installed with debug messages, and hugin's tools use ZThreads automatically (it's a guess).

Can you check that first?
Comment 2 Martin Klapetek 2011-08-24 21:35:18 UTC
Hmm, no ZThread package is installed nor available in my kubuntu repos.
Comment 3 Benjamin Girault 2011-08-24 21:55:34 UTC
Hum, it seems that Hugin has a built-in version of the ZThreads shipped with Hugin's source code. This might be the faulty version then.

I know that several people are using Ubuntu here. Can anybody confirm this? I can change the version checking if it's confirmed.

By the way, I guess that you have KUbuntu 11.04...
Comment 4 Martin Klapetek 2011-08-25 08:19:30 UTC
Yes, it's Kubuntu 11.04. If it's any help, Hugin package is in
'2010.4.0+dfsg-1' version.
Comment 5 Benjamin Girault 2011-08-27 09:21:52 UTC
It's a packaging issue with hugin-tools. My advice it to use Philip Johnsson's PPA to get a clean package of hugin. Note also that it is more recent version of Hugin such that more panoramas will be likely to be correctly stitched.

Ubuntu bug: https://bugs.launchpad.net/ubuntu/+bug/835324
Comment 6 caulier.gilles 2011-09-11 11:43:35 UTC
*** Bug 281794 has been marked as a duplicate of this bug. ***
Comment 7 Frederic Grelot 2011-09-11 11:50:05 UTC
The problem also appears with Fedora 15 unfortuna
Comment 8 Frederic Grelot 2011-09-11 11:51:15 UTC
The problem also appears with Fedora 15 unfortunately : the following bug was with F15 + digikam built from source :
https://bugs.kde.org/show_bug.cgi?id=281794
Comment 9 Benjamin Girault 2011-09-11 19:54:42 UTC
The problem is the same for FC15 than for Ubuntu: the hugin package is shipped with a copy of ZThread built with debug (there shouldn't be debug activated on a stable software).

Moreover, it seems not to be a problem with Hugin 2010.4 since on Mageia it is working (if I remember correctly).
Comment 10 Martin Klapetek 2011-09-12 12:47:02 UTC
I do understand the problem, but couldn't you make the parsing somewhat smarter? Because you may run into other distributions/versions with this exact same problem. So wouldn't it be better to parse the whole output and not just the first line?
Comment 11 Benjamin Girault 2011-09-12 20:46:40 UTC
I was trying to avoid that. It is not difficult to do it, it's just that it's a hack, and, as such, I believe that it should be made by a packager since it is definitely a problem of packaging.

By the way, changing the parsing would make it dumber rather than smarter because it then assumes less about the output.

What I can do is provide here a patch for distributions with a faulty hugin package.
Comment 12 Benjamin Girault 2011-09-12 20:49:03 UTC
Created attachment 63601 [details]
Panorama Patch for Faulty Hugin Package

Here is a patch against kipi-plugins-2.1.0. Use it if compiling with a hugin version shipped with debug support within hugin's version of ZThread. (patch not tested).
Comment 13 Martin Klapetek 2011-09-12 22:54:10 UTC
Doesn't seem to be working. Here's the output:

digikam(7372)/KIPI (general) KIPIPanoramaPlugin::AutoOptimiserBinary::checkSystem: "autooptimiser"  help header line: 
 ""
digikam(7372)/KIPI (general) KIPIPanoramaPlugin::CPCleanBinary::checkSystem: "cpclean"  help header line: 
 ""
Comment 14 Benjamin Girault 2011-09-13 05:37:31 UTC
Can you run and show here the output of "cpclean -h" and "autooptimiser -h"?
Comment 15 Martin Klapetek 2011-09-13 08:23:06 UTC
$ cpclean -h
cpclean: remove wrong control points by statistic method
cpclean version 2010.4.0.854952d82c8f

Usage:  cpclean [options] input.pto
...(about a dozen of other lines)...

$ autooptimiser -h
autooptimiser: optimize image positions                                                                                                                                          
autooptimiser version 2010.4.0.854952d82c8f                                                                                                                                      
                                                                                                                                                                                 
Usage:  autooptimiser [options] input.pto                                                                                                                                        
   To read a project from stdio, specify - as input file.
...
Comment 16 Benjamin Girault 2011-09-13 17:56:28 UTC
Created attachment 63624 [details]
New patch for Hugin's ZThreads

Here is a new patch, again without warranty...
Comment 17 tps 2011-11-14 21:14:07 UTC
Looks like this error/bug isn't gone at all. With nightly from hugin I'll get the very same error again.

And: to make the mess bigger:
$ cpfind --version
Hugin's cpfind 2011.4.0.9d834b027bef
based on Pan-o-matic by Anael Orlinski
my version message: 0.1

ZTreads are not installed nor compiled on this particular machine ...

Using Ubuntu 11.10 (oneiric).
ii  digikam             2:2.3.0-oneiric~ppa2
ii  digikam-data        2:2.3.0-oneiric~ppa2
ii  kipi-plugins        2:2.3.0-oneiric~ppa2
ii  kipi-plugins-common 2:2.3.0-oneiric~ppa2
ii  libkipi-data        4:4.7.2-oneiric~ppa1up
ii  libkipi8            4:4.7.2-oneiric~ppa1up
ii  hugin               2011.3.0+hg5667-0ubuntu1~oneiric
ii  hugin-data          2011.3.0+hg5667-0ubuntu1~oneiric
ii  hugin-tools         2011.3.0+hg5667-0ubuntu1~oneiric
Comment 18 tps 2011-11-14 21:26:09 UTC
A quick fix for the maybe missing line:

-----
#!/bin/sh
echo "ThreadQueue created"
exec cpfind-bin $*
-----

didn't help. Even redirecting it to errorout didn't do it.
Comment 19 Benjamin Girault 2011-11-14 22:34:19 UTC
(In reply to comment #17)
> $ cpfind --version
> Hugin's cpfind 2011.4.0.9d834b027bef
> based on Pan-o-matic by Anael Orlinski
> my version message: 0.1

This bug is different from the one of this bug report. You were right to open a new bug report (namely #286633). Further discussion about it will be made on its dedicated bug report page.