Hi,
Using Hugin 2017.0 (and prior versions), if one tries to stitch a project where there are non-ascii characters in the project's file path the stitching fails.
This is related to bug https://bugs.launchpad.net/hugin/+bug/678808 and its duplicates.
After some debugging it turns out that the culprit is the call to hugin_stich_project using wxExecute. wxExcute does a poor (buggy) handling of converting the internal Unicode representation to UTF-8 and drops any arguments containing non-ascii characters. The attached bug works around it, and solves the issue.
Sorry, but I can't reproduce the issue. It works fine here also with non-ascii characters (tested on Fedora).
$ strace -s 1000 -f -t -v -e trace=process -o huing_good.strace hugin /tmp/hugin/abcd/IMG_0421\ -\ IMG_0421.pto
execve("/usr/bin/hugin_stitch_project", ["hugin_stitch_project", "--delete", "-o", "/tmp/hugin/abcd/IMG_0421 - IMG_0421", "/tmp/huginpto_WrUC2G"],...
strace -s 1000 -f -t -v -e trace=process -o huing.strace hugin /tmp/hugin/אבגד/IMG_0421\ -\ IMG_0421.pto
execve("/usr/bin/hugin_stitch_project", ["hugin_stitch_project", "--delete", "-o", "", "/tmp/huginpto_c4sLVF"],...
execve("/usr/bin/nona", ["/usr/bin/nona", "-v", "-z", "LZW", "-r", "ldr", "-m", "TIFF_m", "-o", "/tmp/huginpto_w9GzzF"],
execve("/usr/bin/nona", ["/usr/bin/nona", "-v", "-z", "LZW", "-r", "ldr", "-m", "TIFF_m", "-o", "IMG_0421 - IMG_0421", "/tmp/huginpto_HoUdv9"],
This is related to bug https://bugs.launchpad.net/hugin/+bug/678808 and its duplicates.Sorry, but this bug is Windows only and has nothing to do with wxExecute.
After some debugging it turns out that the culprit is the call to hugin_stich_project using wxExecute. wxExcute does a poor (buggy) handling of converting the internal Unicode representation to UTF-8 and drops any arguments containing non-ascii characters. The attached bug works around it, and solves the issue.If you think that this is a wxWidgets bug, then it should be reported and fixed upstreams in wxWidgets.
But until now nobody else on Linux reported this bug so far. So this is really strange and maybe related to some special configuration on your side.
You have also only fixed the call to hugin_stitch_project but left the call of PTBatcherGUI, which is also called by wxExecute in a similar way.
I'm using Debian 9, with the en_IL.utf8 locale.
The steps I've taken to reproduce the bug are:1. Start a new project where the pto is in some non-ascii path and set the output prefix to be in the same directory (with non-acii name).
2. Attempt to stitch.
3. hugin_stitch_project is executed and fails. I've attached the log it shows.
--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/0FDA9D23-03D8-4350-BE1D-49F125BCC6B0%40postle.net.
For more options, visit https://groups.google.com/d/optout.
Am Sonntag, 24. September 2017 21:09:47 UTC+2 schrieb Guy Rutenberg:I'm using Debian 9, with the en_IL.utf8 locale.
More interesting would be the wxWidgets version and maybe wxWidgets configuration (e.g. it is compiled as Unicode version or is Unicode disabled).
The steps I've taken to reproduce the bug are:1. Start a new project where the pto is in some non-ascii path and set the output prefix to be in the same directory (with non-acii name).
2. Attempt to stitch.
3. hugin_stitch_project is executed and fails. I've attached the log it shows.
By default the stitching processor is PTBatcherGUI and not hugin_stitch_project. So you have already changed some settings.
But again it works fine here on Fedora. I can't reproduce it here.Here the output from strace:execve("/usr/local/bin/hugin_stitch_project", ["hugin_stitch_project", "--delete", "-o", "/home/xxx/\320\257\320...<snip>/pano", "/tmp/huginpto_v9oFXG"],You see the non-ascii name is correctly passed to hugin_stitch_project.
execve("/usr/bin/PTBatcherGUI", ["/usr/bin/PTBatcherGUI", "-b", "-v", "/tmp/hugin/abcd/IMG_0421 - IMG_0421.pto", "/tmp/hugin/abcd/IMG_0421 - IMG_0421"],...
execve("/usr/bin/PTBatcherGUI", ["/usr/bin/PTBatcherGUI", "-b", "-v", "", ""],...
So this is not a principal bug, it seems to depend on a special configuration or an older wxWidgets version.
PS: Information about wxWigets in Fedora
wxWidgets Library (wxGTK port)
Version 3.0.2 (Unicode: wchar_t, debug level: 1),
compiled at Oct 5 2016 02:40:16
Runtime version of toolkit used is 3.18.
Compile-time GTK+ version is 3.18.9.
Could this be a problem with right-to-left text? Do you see the same error with non-ascii European characters?: øéßæç…
I seem to remember that wxWidgets 3.1.x is much better in respect to uncode support. But as it is officially "development" it is not used everywhere......and the problem wxMaxima always has can be relevant here, too: what if wxWidgets uses Unicode, but the file system doesn't?
But with non-asciiand PTBatcherGUI gives "Could not open project file:/tmp/" when stitching.
execve("/usr/bin/PTBatcherGUI", ["/usr/bin/PTBatcherGUI", "-b", "-v", "", ""],...
Okay, I found the ticket: http://trac.wxwidgets.org/ticket/16206It is indeed fixed upstreams in the 3.1 series, but not in there 3.0.x seriesMaybe Fedora has applied this fix to their packages (but I could not find it. Maybe somebody else can check this).The best way would be to ask the Debian packages to apply this patch to their wxGTK package (instead of fixing each wxExecute in Hugin. This would be a big work.)
Hi,On 26 September 2017 at 18:28, T. Modes <Thomas...@gmx.de> wrote:Okay, I found the ticket: http://trac.wxwidgets.org/ticket/16206It is indeed fixed upstreams in the 3.1 series, but not in there 3.0.x seriesMaybe Fedora has applied this fix to their packages (but I could not find it. Maybe somebody else can check this).The best way would be to ask the Debian packages to apply this patch to their wxGTK package (instead of fixing each wxExecute in Hugin. This would be a big work.)
A C program inherits its locale environment variables when it starts up. This happens automatically. However, these variables do not automatically control the locale used by the library functions, because ISO C says that all programs start by default in the standard ‘C’ locale. To use the locales specified by the environment, you must call
setlocale
. Call it as follows:setlocale (LC_ALL, "");to select a locale based on the user choice of the appropriate environment variables.
Thanks! I've sent a bug report to Debian, and I hope they would be able to apply this patch.
Looking again at wxWidgets' ticket, I saw that hugin does not call wxSetlocale, which means that it doesn't properly inherit the locale from the environment. I've applied the following patch
and it now wxExecute behaves properly. According to libc's docs this should be done in every localized program.A C program inherits its locale environment variables when it starts up. This happens automatically. However, these variables do not automatically control the locale used by the library functions, because ISO C says that all programs start by default in the standard ‘C’ locale. To use the locales specified by the environment, you must call
setlocale
. Call it as follows:setlocale (LC_ALL, "");to select a locale based on the user choice of the appropriate environment variables.
Calling wxSetlocale on Windows have unwanted side effects. After it the numbers are not correctly formatted.
Does also setlocale work, or have it to be wxSetLocale? (setlocale works here on Windows without the side effects of wxSetlocale).
Does also setlocale work, or have it to be wxSetLocale? (setlocale works here on Windows without the side effects of wxSetlocale).`setlocale` works just as well. If I understand the #if's correctly, the line I've edited would not affect Windows at all (as __WXMSW__ is not defined).