marianosimone / epub-thumbnailer

Script to extract the cover of an epub book and create a thumbnail for it
GNU General Public License v3.0
191 stars 29 forks source link

Failed in Fedora 34 #35

Closed maxreuben closed 2 years ago

maxreuben commented 2 years ago

The script failed to determine desktop environment in nautilus 40.2 in Fedora 34 x86_64 running Gnome 40.7 and Default WM (Mutter?):-

Checking dependencies ...

Required dependencies:
    Python Imaging Library .......
OK

Installing epub-thumbnailer to /usr/bin/ ...
OK

Could not determine your desktop environment version. You can still use the thumbnailer script manually.

For example:

    epub-thumbnailer Lawrence\ Lessig\ -\ Free\ Culture.epub cover.png 128

Also, please consider reporting this in https://github.com/marianosimone/epub-thumbnailer/
including information about your distribution, window manager, file manager and the result of `ps -A`

The script doesn't work from cli either. When i run epub-thumbnailer <filename>.epub :-

Traceback (most recent call last):
  File "/usr/bin/epub-thumbnailer", line 132, in <module>
    output_file = sys.argv[2]
IndexError: list index out of range

Output of ps -A: ps.txt

python --version: Python 3.9.9

Similar issue has been reported in Ubuntu 21.10 #34 which runs the same desktop environment.

marianosimone commented 2 years ago

Thanks for reporting!

I don't have access to a box with that configuration, but could you try this instead?

In the install.py that you downloaded, replace: https://github.com/marianosimone/epub-thumbnailer/blob/master/install.py#L68-L78

with:

VERSION_GUSSERS = {
    'gnome-shell': gnome_shell_version
}

After that, try re-running the installer.

If that doesn't work, could you share the output of running gnome-session --version in a terminal?

For your test run, though, it seems like you missed one parameter:

epub-thumbnailer <filename>.epub vs epub-thumbnailer <filename>.epub <size>

maxreuben commented 2 years ago

Sorry, That didn't work. gnome-session --version prints nothing. gnome-shell --version prints GNOME Shell 40.7

The command worked from cli and gave the correct output when all the arguments were given like you said.

marianosimone commented 2 years ago

Thanks for following up! Could you try one more thing?

What happens if you change: https://github.com/marianosimone/epub-thumbnailer/blob/master/install.py#L66 to:

return ('gnome%s' % major_version)

(and keep the change for the VERSION_GUESSER in https://github.com/marianosimone/epub-thumbnailer/issues/35#issuecomment-1008366158)

maxreuben commented 2 years ago

The same error persists on running python install.py install. The thumbnails don't show up in nautilus.

Output of ps -A

marianosimone commented 2 years ago

Thanks for bearing with me while I try to debug this without access to a similar setup :)

Can you confirm that with those two changes, you are still seeing the error message that says "Could not determine your desktop environment version. You can still use the thumbnailer script manually."?

If so, can you give me the output of ps -A | grep 'gnome-shell$'? From the output you've shared so far, I'd expect to see at least one line for that, so I'd be surprised if the installer kept failing.

maxreuben commented 2 years ago

Thank you for being so prompt in responding to this issue. Most developers don't do that. :)

Yes, I can confirm that I see that error message despite making those changes you requested.

ps -A | grep 'gnome-shell$':

reuben      3059  1.1  2.1 5076644 347940 ?      Ssl  07:00   3:15  \_ /usr/bin/gnome-shell
marianosimone commented 2 years ago

Oh, I missed one more change (I can almost promise this is the last one!)

Can you change this line from elif environment in ('gnome3', 'xfce4', 'unity', 'openbox', 'enlightenment', 'i3', 'pantheon'): to elif environment is not None

(maintaining the other two changes!)

maxreuben commented 2 years ago

That worked. Thanks!

marianosimone commented 2 years ago

Great, @maxreuben can you confirm that this both installed and made thumbnails start appearing? If so, I'll fix the code to get a new version out with all these fixes.

Thanks a lot for helping me figure it out!

jhossettstalinn commented 2 years ago

It works on Ubuntu 21.10 too, and it is installed. Thank you.

ghost commented 2 years ago

Fedora 35, I can confirm this both installed and made thumbnails start appearing at the same time. Thanks !

maxreuben commented 2 years ago

@marianosimone Yes, I can confirm that this is installed and the thumbnails are working. Thanks!

marianosimone commented 2 years ago

Thanks both for the confirmations. The new version is up!