pano_modify --rotate does not detect values < abs(1) on hugin 2016.0

Bug #1575120 reported by MHorn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hugin
Fix Released
Undecided
Unassigned

Bug Description

If on command line a pano_modify --rotate parameter is given, pano_modify checks for valid values with (pano_modify.cpp, line 745):

if (abs(yaw) + abs(pitch) + abs(roll) > 0.0)

If I'm not mistaken, abs() expects ints and the if-case will therefore return false, if no parameter is > abs(1)

System Information:
Betriebssystem: Linux 4.2.0-23-generic x86_64
Architektur: 64 bit
Freier Speicher: 140012862658896 kiB

Hugin
Version: 2016.0.0.3b4e2790cb90
Ressourcen-Pfad: /usr/share/hugin/xrc/
Datenpfad: /usr/share/hugin/data/
Hugins Kamera- und Objektivdatenbank: /home/xxx/.hugindata/camlens.db
Multi-Threading mittels C++11 std::thread und OpenMP

Bibliotheken
wxWidgets: wxWidgets 3.0
wxWidgets Library (wxGTK port)
Version 3.0.0 (Unicode: wchar_t, debug level: 1),
compiled at Dec 2 2013 15:56:33

Runtime version of toolkit used is 2.24.
Compile-time GTK+ version is 2.24.22.

libpano13: 2.9.19
Boost: 1.54.0
Exiv2: 0.23
SQLite3: 3.8.2
Vigra: 1.10.0
LittleCMS2: 2.5

Revision history for this message
MHorn (m-horn) wrote :

I downloaded the source and made changes that appear to work for me (2016 branch):
in pano_modify.cpp:
add
#include <math.h>

and replace abs() with fabs()

Slightly off topic, I asked google how to submit a patch but couldn't find an easy answer within the first few minutes.
For future reference, Is there a short and easy way to generate a patch for this rather easy example?
Thanks

Revision history for this message
tmodes (tmodes) wrote :

No, in C++ there are also double variants of abs.
But it is differently used by different compilers.
Fixed in repository.

Nevertheless, who needs such small angles for rotating without a GUI?

Changed in hugin:
status: New → Fix Committed
Revision history for this message
MHorn (m-horn) wrote :

I do ;)

I work with several already stitched full spherical stereoscopic image pairs and use hugin for the final transformation towards the target projection and fov while making small adjustments to all of them.
Using the gui each time was tedious, so I scripted the whole process.

Thanks and cheers.

tmodes (tmodes)
Changed in hugin:
milestone: none → 2016.2beta1
tmodes (tmodes)
Changed in hugin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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