Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Wallpaper Creator - Unable to create video wallpaper in python rewrite #93

Open
Kangie opened this issue Mar 10, 2024 · 1 comment

Comments

@Kangie
Copy link
Member

Kangie commented Mar 10, 2024

What I did

Attempt to create a video wallpaper from a file on a local disk

What I got

PYTHONPATH="/usr/local/lib/python3.11/site-packages:${PATH}" python3.11 /usr/local/bin/komorebi-wallpaper-creator --log=DEBUG 
Welcome to komorebi Wallpaper Creator
[DEBUG] (22:20:26): Gtk initialized
[DEBUG] (22:20:26): Loading WallpaperWindow...
[DEBUG] (22:20:27): Loaded WindowWallpaper
/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/window.py:156: RuntimeWarning: Expecting to marshal a borrowed reference for <GdkPixbuf.Pixbuf object at 0x7fbed1585980 (GdkPixbuf at 0x562db3e81350)>, but nothing in Python is holding a reference to this object. See: https://bugzilla.gnome.org/show_bug.cgi?id=687522
  self.options_page.set_blank()
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/window.py", line 166, in _on_next_btn_released
    self.stack.add_named(pages.FinalPage(), 'final')
                         ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/pages.py", line 597, in __init__
    self.create_wallpaper()
  File "/usr/local/lib/python3.11/site-packages/komorebi/wallpaper_creator/pages.py", line 624, in create_wallpaper
    Gio.File.new_for_path(utilities.thumbnail_path).copy(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Argument 0 does not allow None as a value

The wallpaper is created, but komorebi thinks that it is invalid.

The wallpaper directory only contains a copy of the video file and no configuration.

What I expected

For the wallpaper creator to succeed when not given a thumbnail!

Note: [WARNING] (22:23:52): found an invalid wallpaper with name: komorebi.gresource should probably be fixed here too.

@Kangie
Copy link
Member Author

Kangie commented Mar 10, 2024

In this case the issue is because if a thumbnail is not specified we try and unconditionally move(!) it into the dir anyway and never end up writing out the wallpaper config.

Gio.File.new_for_path(utilities.thumbnail_path).copy(
Gio.File.new_for_path(os.path.join(dir_path, 'wallpaper.jpg')),
Gio.FileCopyFlags.NONE

What we really need to do is:

  • In the case of video generate a thumbnail (or series of thumbnails) directly from the video if one is not provided. The user can pick the best looking one (or we could make an apng...)
  • In the case of a web page, invoke WebKit2 to generate a capture of the website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant