enfuse_pro plugin - cross-platform compatible


(Mica) #21

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

(Hevii Guy) #22

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:

(Tobias) #23
  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:

(Hevii Guy) #24

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

(Andreas Schneider) #25

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:

(Hevii Guy) #26

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


(Mica) #27

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.

(Hevii Guy) #28

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

echo $PATH


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

(Tobias) #29

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

(Hevii Guy) #30

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

(Hevii Guy) #31

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

heviiguy@heviiApfel ~$ which enfuse
heviiguy@heviiApfel ~$ which align_image_stack
heviiguy@heviiApfel ~$ 

The align_image_stack executable is located at:

Yet, it does seem to be in my path:

echo $PATH                                              

(Hevii Guy) #32

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
Saving session...
...copying shared history...
...saving history...truncating history files...

[Process completed]

(Mica) #33

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

(Hevii Guy) #34

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

The executables are called from the correct location:

heviiguy@heviiApfel ~$ which enfuse
heviiguy@heviiApfel ~$ which enblend
heviiguy@heviiApfel ~$ which 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:

(Kevin E) #35

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:


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…

(Hevii Guy) #37

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:

(Kevin E) #38


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.

(Hevii Guy) #39

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'

(Hevii Guy) #40

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:

(Kevin E) #41

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!