Bug 479268 - Provide helpful info on why exiftool is not recognised
Summary: Provide helpful info on why exiftool is not recognised
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-ExifTool (show other bugs)
Version: 8.1.0
Platform: NixOS Linux
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-01 18:03 UTC by Thibault Lemaire
Modified: 2024-01-01 22:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.3.0
Sentry Crash Report:


Attachments
File picker detecting exiftool, but tooltip reading "binary not found." (196.18 KB, image/png)
2024-01-01 18:03 UTC, Thibault Lemaire
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thibault Lemaire 2024-01-01 18:03:37 UTC
Created attachment 164600 [details]
File picker detecting exiftool, but tooltip reading "binary not found."

SUMMARY

digiKam gives very little information as to why `exiftool` is not found, and that information was wrong in my case as exiftool **was** found, it just did not work correctly.


STEPS TO REPRODUCE
1. Change one of your locale settings to something that's not installed on your system (e.g. in KDE System Settings > Region & Language > Currency)
2. Log out and back in
3. In digiKam, go to Settings > configure digiKam... > Metadata > ExifTool and witness the binary not being found. 

or alternatively, just hack exiftool to output garbage (it's just a perl script after all)

OBSERVED RESULT

Hovering the 🚫 symbol next to `exiftool` shows a tooltip with the text "binary not found." 

EXPECTED RESULT

At least show "binary not recognised" instead, when the binary exists but emits unexpected output.

And better yet: Show the attempted command and its resulting output to the user.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.1.69-xanmod1 (64-bit)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION

I have `exiftool` installed, yet digikam does not detect it. I opened the file picker dialogue, found the location of the binary (which was correctly detected/filtered by the file picker) and selected it. The file picker closed, as if satisfied, but I was left with a blank ExifTool tab, and the unhelpful tooltip "binary not found."

I say "unhelpful" for 2 reasons:

1. It is not obvious to me that you have to hover over the 🚫 icon to get information on what went wrong
2. I actually found the issue, and it wasn't that the binary was not found, but rather that it did not output what digiKam was expecting:

```sh
❯ exiftool -ver
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "",
        LC_ALL = (unset),
        LC_MONETARY = "fr_FR.UTF-8",
        LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
12.70
```

exiftool is actually working perfectly fine, but just outputting garbage that (I guess) digiKam cannot parse. Thankfully once I had identified the issue, fixing it was pretty easy.

But the logical path from "digiKam cannot not find `exiftool`" to "you have an issue with your locale settings" was really not obvious and I just spent the better part of day investigating that. I would have probably given up immediately hadn't I had another machine on which digiKam recognised `exiftool` out of the box.
Comment 1 caulier.gilles 2024-01-01 20:28:44 UTC
Comment on attachment 164600 [details]
File picker detecting exiftool, but tooltip reading "binary not found."

Probably a execution right not set. Can you show the file property of exiftool executable ?
Comment 2 Thibault Lemaire 2024-01-01 20:44:38 UTC
(In reply to caulier.gilles from comment #1)
> Comment on attachment 164600 [details]
> File picker detecting exiftool, but tooltip reading "binary not found."
> 
> Probably a execution right not set. Can you show the file property of
> exiftool executable ?

Thank you, but have you read the ticket in full?

I have solved the issue on my own, I'm just asking for digiKam to provide more info so others might solve the same kind of issue quicker
Comment 3 Maik Qualmann 2024-01-01 20:59:37 UTC
Honestly, I don't see that we should change anything here. Our binary search did not find a working exiftool because the version could not be queried due to the perl language error message. Maybe it would help in this case if we showed the version output, but in most cases it would just be blank.

Maik
Comment 4 Thibault Lemaire 2024-01-01 21:26:09 UTC
(In reply to Maik Qualmann from comment #3)
> Honestly, I don't see that we should change anything here. Our binary search
> did not find a working exiftool because the version could not be queried due
> to the perl language error message. Maybe it would help in this case if we
> showed the version output, but in most cases it would just be blank.
> 
> Maik

Ok, showing the output might be a lot of work for an arguably rare case.

But wouldn't it be feasible to distinguish between "binary not found" (i.e. could not find a file called "exiftool") and e.g. "binary not suitable" or "could not determine version" (i.e. there is a file called "exiftool", it might even have been manually selected by the user, but we couldn't parse a version) ?

I was hopelessly looking for issues with permissions, SELinux, and symlinking, and did not even think to check the output of exiftool.

It might not seem like that big a difference but "binary not found" is clearly not the right message here, and completely mislead me. At the very least I would ask to just change that tooltip into "binary not found or not working".

Also, if the argument is about the amount of work to put into implementing this, then I can offer to do it myself. Although unfamiliar with digiKam's codebase, I'm a C++ developper. I'll let you people judge the maintenance costs though.
Comment 5 Maik Qualmann 2024-01-01 21:39:53 UTC
Git commit b06b639c286ebb9f9f277d66d1f3b0341cbef809 by Maik Qualmann.
Committed on 01/01/2024 at 22:39.
Pushed by mqualmann into branch 'master'.

add error flag to the binary search
FIXED-IN: 8.3.0

M  +1    -1    NEWS
M  +7    -1    core/libs/widgets/files/dbinaryiface.cpp
M  +2    -0    core/libs/widgets/files/dbinaryiface.h
M  +8    -0    core/libs/widgets/files/dbinarysearch.cpp

https://invent.kde.org/graphics/digikam/-/commit/b06b639c286ebb9f9f277d66d1f3b0341cbef809
Comment 6 Thibault Lemaire 2024-01-01 22:12:54 UTC
Awesome! Thank you!