enfuse_pro plugin - cross-platform compatible

how did you install hugin? Could the path difference be something like login vs non-login shell?

I installed hugin (almost) just like any other Mac OS app: Loaded the .dmg and then dragged the hugin folder along with its contained apps into the applications directory. I also loaded a separate enblend-enfuse package since the hugin .dmg surprisingly didn’t include these core executables (align_image_stack is provided by the latter)

I modified my path by:
sudo -s 'echo "/Applications/enblend-enfuse-4.0-mac/enfuse" > /etc/paths.d/enfuse’_ _ sudo -s 'echo “/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack” > /etc/paths.d/align_image_stack’

I don’t think that the issue is due to login vs non-login shell because not only am I able to access the hugin gui by double-clicking the app icon, I’m also able to run enfuse and align-image-stack successfully by calling them from the command line.

For example, to call enfuse:
$ /Applications/enblend-enfuse-4.0-mac/enfuse

Likewise, for align_image_stack:
$ /Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack

So, I’m still stuck and unable to have the lua script process my photos as desired (and as intended by the script’s developer) :confused:

  1. Do you get any errors if you start dartable from the command line with:

darktable -d lua

  1. You should write a bugreport here:
    Issues · BzKevin/enfuse_pro_2-dt-plugin · GitHub

Yes, Tobias, after running
$ /Applications/darktable.app/Contents/MacOS/darktable -d lua
I get the following error:

(process:70921): Gtk-WARNING **: 13:46:27.136: Locale not supported by C library.
	Using the fallback 'C' locale.

(darktable-bin:70921): GLib-GObject-WARNING **: 13:46:27.523: invalid cast from 'GtkMenuBar' to 'GtkWindow'

(darktable-bin:70921): Gtk-CRITICAL **: 13:46:27.523: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
3.168631 LUA ERROR registering import filter `ignore jpegs'
3.169070 LUA ERROR registering import filter `prefer raw over jpeg'
sh: xdg-user-dir: command not found
12.642492 LUA ERROR : error loading module '/contrib/gps_select' from file '/Users/heviiguy/.config/darktable/lua//contrib/gps_select.lua':
	...s/heviiguy/.config/darktable/lua//contrib/gps_select.lua:28: ')' expected near '{'
73.209119 LUA ERROR align_image_stack not found. please install hugin.
rm: /Users/heviiguy/.local/tmp/*.tif: No such file or directory

It would be really great to have better documentation for that script. Does someone understand the details and could start writing such a thing? :slight_smile:

Although it’s written in German, perhaps the following may help:

https://www.multimedia4linux.de/index.php/bildbearbeitung/darktable/darktable-plugin-enfuse-professional/2-uncategorised/143-darktable-tutorial-pano-pro-plugin

If align_image_stack is on your path, you should be able to call it without specifying the full path.

Also usually you’d only put the path to the folder that contains the binary, not the full path to the binary, e.g. /Applications/Hugin/Hugin.app/Contents/MacOS/ not /Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack.

Albeit apparently too direct, it appears that it is indeed on my path:

echo $PATH

/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack:/Applications/enblend-enfuse-4.0-mac/enblend:/Applications/enblend-enfuse-4.0-mac/enfuse:/Applications/Hugin/Hugin.app/Contents/MacOS/Hugin

I’ll take note of your comment, Mica, and clean-up my path :wink:

Do you have more scripts in your luarc? If yes, please disable all to get a cleaner error log.

I had removed everything from the luarc file except:

require "/official/yield"

require "/contrib/enfuse_pro"

Running dt from the command line produces the following:

(process:36223): Gtk-WARNING **: 17:50:48.198: Locale not supported by C library.
	Using the fallback 'C' locale.

(darktable-bin:36223): GLib-GObject-WARNING **: 17:50:48.513: invalid cast from 'GtkMenuBar' to 'GtkWindow'

(darktable-bin:36223): Gtk-CRITICAL **: 17:50:48.513: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
47.657343 LUA ERROR align_image_stack not found. please install hugin.
rm: /Users/heviiguy/.local/tmp/*.tif: No such file or directory

Substituting the enfuse_pro2 for the enfuse_pro script produces a slightly different result, yet also failing when align_image_stack is called:

(process:38423): Gtk-WARNING **: 17:57:36.316: Locale not supported by C library.
	Using the fallback 'C' locale.

(darktable-bin:38423): GLib-GObject-WARNING **: 17:57:36.641: invalid cast from 'GtkMenuBar' to 'GtkWindow'

(darktable-bin:38423): Gtk-CRITICAL **: 17:57:36.641: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
38.508668 LUA Executable Path Preference: align_image_stack
38.509962 LUA ERROR align image stack not found
38.510016 LUA Deleting temp files...
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file
38.545871 LUA Done deleting

Apparently, align_image_stack, unlike enfuse, is not in my path:

heviiguy@heviiApfel ~$ which enfuse
/Applications/Hugin/tools_mac/enfuse
heviiguy@heviiApfel ~$ which align_image_stack
heviiguy@heviiApfel ~$ 

The align_image_stack executable is located at:
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack

Yet, it does seem to be in my path:

echo $PATH                                              
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack:/Applications/enblend-enfuse-4.0-mac/enblend:/Applications/enblend-enfuse-4.0-mac/enfuse

One more thing: The align_image_stack executable on my box isn’t a “dud” because when I double-click it, I get the following:

/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack ; exit;
align_image_stack: At least two files need to be specified
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Try putting the path to the folder, not the path to the executable binary in your path!

Edit: can you also check that align image stack is marked as executable? If not, then chmod 755 /path/to/align_image_stack

Thanks for your patience (and continued help!)

Cleaned-up the mess which was my path so that all other hugin references were removed:

echo $PATH
/Applications/Hugin/HuginStitchProject.app/Contents/MacOS

The executables are called from the correct location:

heviiguy@heviiApfel ~$ which enfuse
/Applications/Hugin/HuginStitchProject.app/Contents/MacOS/enfuse
heviiguy@heviiApfel ~$ which enblend
/Applications/Hugin/HuginStitchProject.app/Contents/MacOS/enblend
heviiguy@heviiApfel ~$ which align_image_stack
/Applications/Hugin/HuginStitchProject.app/Contents/MacOS/align_image_stack

The file permissions appear to be correct:

heviiguy@heviiApfel MacOS$ ls -l 
total 21504
-rwxr-xr-x@ 1 heviiguy  admin   143860 Jan 27 12:46 HuginStitchProject
-rwxr-xr-x@ 1 heviiguy  admin  1826344 Jan 27 12:40 align_image_stack
-rwxr-xr-x@ 1 heviiguy  admin  3313084 Jan 27 12:40 enblend
-rwxr-xr-x@ 1 heviiguy  admin  3587880 Jan 27 12:40 enfuse
-rwxr-xr-x@ 1 heviiguy  admin   266004 Jan 27 12:40 hugin_hdrmerge
-rwxr-xr-x@ 1 heviiguy  admin   120700 Jan 27 12:40 nona
-rwxr-xr-x@ 1 heviiguy  admin  1744196 Jan 27 12:40 verdandi

I’m stumped! (and a few other choice descriptives) :face_with_symbols_over_mouth:

1 Like

Thanks to all who have been trying to help Hevii out! I am confused by Hevii’s first comment. With enfuse_pro_2 there should be boxes under lua preferences inside darktable’s settings dialog allowing you to point to the locations of the binaries:

image

You do not have this? (note this is only true for version 2 of the script, version 1 does not have this).

Also, as an aside this is why I have not requested it be added to the master Lua set yet, I am not sure if the cross-platform aspect works yet. I have confirmed it works on Windows and Linux, not sure if anyone has tried on MacOS prior to Hevii…

1 Like

What an utter and complete idiot I am! A classic case reminiscent of RTFM. Or in this situation, RTFGUI.

So yeah, suffice it to say, I do have these options on my box :open_mouth:

Thanks, everybody, for your patience. If nothing else, at least I was able to clean-up my messy Path :face_with_raised_eyebrow:

Great!

Just to reiterate though, I do believe you are the first person (to my knowledge) to try and use it on MacOS, so you MAY (read: probably) will experience more issues. Hopefully not though!

Keep us posted.

Yup: More issues!

It hangs. Here’s the output up to the point where nothing happens (yet I’m still able to interact with the program as if the script hadn’t been invoked):

(process:38531): Gtk-WARNING **: 00:51:34.801: Locale not supported by C library.
	Using the fallback 'C' locale.

(darktable-bin:38531): GLib-GObject-WARNING **: 00:51:35.121: invalid cast from 'GtkMenuBar' to 'GtkWindow'

(darktable-bin:38531): Gtk-CRITICAL **: 00:51:35.121: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
47.687982 LUA Executable Path Preference: /Applications/Hugin/HuginStitchProject.app/Contents/MacOS/align_image_stack
47.688077 LUA Executable Path Preference: /Applications/Hugin/HuginStitchProject.app/Contents/MacOS/enfuse
47.688165 LUA Executable Path Preference: /usr/local/bin/exiftool
47.697349 LUA Starting Image Fusion
47.699080 LUA ERROR : ...heviiguy/.config/darktable/lua//contrib/enfuse_pro_2.lua:605: attempt to call a nil value (field 'length')
stack traceback:
	[C]: in field 'length'
	...heviiguy/.config/darktable/lua//contrib/enfuse_pro_2.lua:605: in upvalue 'build_execute_command'
	...heviiguy/.config/darktable/lua//contrib/enfuse_pro_2.lua:645: in function 'align_images'
	...heviiguy/.config/darktable/lua//contrib/enfuse_pro_2.lua:835: in function 'create_image_fusion'

It works! Well, at least one of them works.

When I tried running the enfuse_pro_2.lua script, it hung, as indicated above. However, when I reverted to the original enfuse_pro.lua script, I was happy to see a blended .tif along with an associated .xmp dumped into the specified directory! :smiley:

1 Like

Ok, glad that the original works for you. You’ll just have to continue to use that until I can get around to playing with v2 and finding the problem.

Thanks for providing the debug output, it will help a lot!