Giter VIP home page Giter VIP logo

flozz / cover-thumbnailer Goto Github PK

View Code? Open in Web Editor NEW
75.0 10.0 20.0 2.07 MB

Generates folder thumbnails for various file browser on Linux to display music album covers, preview of pictures which are in a folder and more.

Home Page: https://blog.flozz.fr/2020/07/15/cover-thumbnailer-apres-plus-de-10-ans-cest-termine/

License: GNU General Public License v3.0

Python 81.95% Shell 18.05%
nautilus thunar caja gnome xfce thumbnailer thumbnail-generator

cover-thumbnailer's Introduction

Cover Thumbnailer

Cover thumbnailer generates folder thumbnails for various file browser on Linux. It displays music album covers, preview of pictures which are in a folder and more.

Example with a music folder:

Screenshot: Nautilus Music folder

Example with a picture folder:

Screenshot: Nautilus Pictures folder

Cover Thumbnailer is free software distributed under the GNU GPL v3+ license, you are free to modify and redistribute it under the terms of the license.

This repository is the continuation of the Bazaar / Launchpad one. This project is in "maintenance mode": no new feature will be added, only fixes will be released when possible.

If You are a developer and want to continue the development of this software, please contact me.

Supported file browsers

As far as I know, Cover Thumbnailer currently works with the following file browsers:

  • Nautilus¹ (GNOME file browser)
  • Thunar (XFCE file browser)
  • Caja (MATE file browser)
  • Nemo (Cinnamon file browser)

NOTE¹: Nautilus support

Since Nautilus started sandboxing thumbnailers, Cover Thumbnailer do not work out of the box with this file borwser anymore. A button have been added to the configuration GUI to generate manually the thumbnails for a specific folder, see bellow.

How does it work?

How Cover Thumbnailer decides what to display on a folder? It depends on the type of the folder and your configuration.

By default, Cover Thumbnailer will detect your main "Music" and "Pictures" folders using the XDG configuration file (~/.config/user-dirs.dirs). You can disable this and / or add other folders using the graphical configuration tool (see bellow).

Music folders

If Cover Thumbnailer is enabled for music folders (it is the case by default) and the current folder is recognized as a music folder, the generated thumbnail will looks like a CD case, with zero, one or more cover on it depending on found pictures and user configuration.

In short

Just put an image with a name like cover.png/jpg, .cover.png/jpg, folder.png/jpg in the folder, and it should work.

In detail

Cover Thumbnailer will first look in the folder itself if an image with one of the following name exists (it searches in this precise order) :

cover.png   cover.jpg   .cover.png   .cover.jpg
Cover.png   Cover.jpg   .Cover.png   .Cover.jpg
folder.png  folder.jpg  .folder.png  .folder.jpg
Folder.png  Folder.jpg  .Folder.png  .Folder.jpg

If yes it will use this image to generate the thumbnail.

If there is no file matching one of the name above, it will search for any picture in a supported format (see "Pictures folders" documentation bellow for a list) in the folder and by default it will use the first one it found, or up to four pictures if the Allow mosaic option is enabled.

If there is still no picture found, it will then search recursively for it and will use the first one or up to four pictures depending of the Allow mosaic option.

If definitively no picture was found, it will display an empty CD case (or the default folder icon depending of your configuration).

Pictures folders

If Cover Thumbnailer is enabled for pictures folders (it is the case by default) and the current folder is recognized as a pictures folder, the generated thumbnail will looks like a portfolio, and up to four pictures found in the folder will be displayed on it.

In short

If any pictures are available in the folder (or its subfolders), they will be used in the thumbnail.

In detail

First, Cover Thumbnailer will look for pictures in any supported format (list bellow) in the folder. If it find at least one, it will stops its search here and will display up to four pictures in the thumbnail, depending of what was found and your configuration (by default it will display up to tree pictures).

If no images were found, it will then search recursively in the folder.

If there is still no picture found, it will display an empty portfolio or the default folder icon depending of your configuration.

List of supported images formats / extensions:

  • .jpg, .JPG, jpeg, JPEG,
  • .png, .PNG,
  • .gif, .GIF,
  • .bmp, .BMP (Window ans OS/2 bitmap),
  • .ico, .ICO (Windows icon format),
  • .tga, .TGA (Truevision Targa format),
  • .tif, .TIF, tiff, TIFF (Adobe Tagged Image File Format),
  • .psd, .PSD (#Adobe Photosop format, only version 2.5 and 3.0).

Other folders

If Cover Thumbnailer is enabled for other folders (it is the case by default), Cover Thumbnailer will search in the folder for a file with a name like cover/folder.png/jpg (same list than for the music).

Installing Cover Thumbnailer

Requirements

Cover Thumbnailer dependencies:

  • PIL / pillow
  • Python bindings for GObject Introspection
  • Introspection files for GTK 3.0
  • GNU gettext

On Debian / Ubuntu, this can be installed using the following command:

sudo apt install gettext python3-pil python3-gi gir1.2-gtk-3.0

On Fedora, you can install the dependencies using this command:

sudo dnf install git gettext python3-pillow python3-gobject

On Arch Linux and Manjaro, the command to install requirements is:

sudo pacman -S git gettext gtk3 python-pillow

Install from source

Clone this repository or download a zip from Github:

git clone https://github.com/flozz/cover-thumbnailer.git

Go to the project folder:

cd cover-thumbnailer/

Install Cover Thumbnailer using the following command:

sudo ./install.sh --install

Ubuntu PPA

There use to be a PPA for Ubuntu, but it is not up to date anymore, please do not use it.

You have to uninstall the package from the PPA before installing Cover Thumbnailer from the sources.

Archlinux AUR

There is a package in AUR for Archlinux:

Uninstalling Cover Thumbnailer

To uninstall Cover thumbnailer, run the following command:

sudo /usr/share/cover-thumbnailer/uninstall.sh --remove

Configuring Cover Thumbnailer

Cover Thumbnailer provides a graphical tool to configure it. You will find it in your application launcher like any other software.

You can also run it with the following command:

cover-thumbnailer-gui

Screenshot of Cover Thumnailer configuration tool

The configuration tool will write the configuration in the ~/.cover-thumbnailer/cover-thumbnailer.conf file. It is a plain-text file, so you can also edit it manually.

Generating Thumbnails

If you are using Thunar, Caja, or Nemo, it should work out of the box: just open a folder and thumbnails should be generated automatically.

If you are using Nautilus, thumbnails cannot be generated automatically in most recent version of this file browser. You can generate thumbnails manually using the configuration tool: in the last tab, just click the "Select a folder and generate thumbnails" button.

Screenshot

NOTE: The thumbnail generation could take a while, just be patient. The thumbnails should appear after a refresh of the folder.

Changelog

  • [NEXT] (changes on master but not released yet):

    • Nothing yet :)
  • v0.10.1 (2023-07-31):

    • Added Pillow >= 10.0 compatibility by replacing deprecated PIL.Image.ANTIALIAS constant by PIL.Image.LANCSZOS (@flozz, #16)
  • v0.10.0 (2020-07-12):

    • Port from Python 2 to Python 3
    • Port the config GUI from GTK 2 (PyGTK) to GTK 3 (GObject Introspection)
    • Adds a button to generates manually the thumbnails (required for Nautilus)
    • Support of Thunar, Caja, and Nemo
    • Update translations
    • various fixes
  • v0.8.4: Old version imported to github

cover-thumbnailer's People

Contributors

alexislefebvre avatar dominicme avatar flozz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cover-thumbnailer's Issues

Does Cover Thumbnailer recognise $XDG_CONFIG_DIR?

Hi! The readme indicates that the config file is installed at ~/.cover-thumbnailer/cover-thumbnailer.conf. I was wondering if this was still accurate, and if it was possible to read config files from $XDG_CONFIG_DIR/cover-thumnailer/cover-thumbnailer.conf or other hardcoded locations like ~/.config/cover-thumbnailer/cover-thumbnailer.conf

I know you use XDG directories for finding the music and pictures folders, thought it might just be out-of-date documentation?

PPA doesn't work for Ubuntu 20.04 / focal

On Ubuntu 20.04, I try to use the PPA:

$ sudo add-apt-repository ppa:flozz/flozz
 This PPA contain ubuntu package of my softwares...
 More info: https://launchpad.net/~flozz/+archive/ubuntu/flozz
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://archive.canonical.com/ubuntu focal InRelease
Ign:2 http://ppa.launchpad.net/flozz/flozz/ubuntu focal InRelease
Hit:3 http://ppa.launchpad.net/nrbrtx/python2-stuff/ubuntu focal InRelease
Err:4 http://ppa.launchpad.net/flozz/flozz/ubuntu focal Release
  404  Not Found [IP: 2001:67c:[…] 80]
Get:5 http://ubuntu.mirrors.ovh.net/ubuntu focal InRelease [265 kB]
Get:6 http://ubuntu.mirrors.ovh.net/ubuntu focal-updates InRelease [107 kB]
Get:7 http://ubuntu.mirrors.ovh.net/ubuntu focal-security InRelease [107 kB]
Reading package lists... Done 
E: The repository 'http://ppa.launchpad.net/flozz/flozz/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

So the Release file is missing for focal.

Preview for folder not showing in nautilus

Hi, I just downloaded cover-thumbnailer because I wanted folder previews for images inside the folder. Unfortunately its only showing the default icon also if there are jpegs inside. Nautilus version is 3.26.4.

Validating source files with sha256sums ..FAILED

AUR installed version was cover-thumbnailer 0.10.0-2

Found cover-thumbnailer-0.10.1.tar.gz
==> Validating source files with sha256sums...
cover-thumbnailer-0.10.1.tar.gz ... FAILED
==> ERROR: One or more files did not pass the validity check!
-> error making: cover-thumbnailer-exit status 1
-> Failed to install the following packages. Manual intervention is required:
cover-thumbnailer - exit status 1

webp support

Currently it only works if you rename your files to .png

BTW thanks for this awesome project. It makes browsing your pictures such a breeze, no need to setup a bloated and broken image server... I can't live without it anymore!

Thanks....

Just switch from Ubuntu to Fedora and had to reinstall your utility.

Works great. I love it.

Thanks for your work.

non squared thumbs for "other" folders (films etc..)

Hi,
I'm unable to generate non-squared thumbnails for other type of folders.
I tried changing the value crop=True by crop=False in the main file at line 518 but after that it does not generate anymore...
Thanks.

(I 'm on debian testing, Files version 3.38.2)

wrong thumbnail image used for music folders

I recently updated to Fedora 27 and installed the latest version on cover-thumbnailer (0.8.4) from git repository.
nautilus = 3.26, nautilus-python = 1.1, python = 2.7.13 and 3.6.3, python-pillow = 4.3.0, PyGI = 3.26.0

When i access the music folder available in "list of folder" from config, only folder containing cover.png is show with thumbnail background and that too using "other_fg.png" instead of "music_bg.png"

It was working fine in Fedora 26.

Thumbnails are not generated on Ubuntu 20.04

I used cover-thumbnailer on Ubuntu 19.10 and it worked perfectly.

I upgraded to Ubuntu 20.04 and the package was removed. So I installed it through source, I was able to install but it doesn't work.

I think I found why by adding some debug code:

diff --git a/cover-thumbnailer.py b/cover-thumbnailer.py
index 5078307..8508d9d 100755
--- a/cover-thumbnailer.py
+++ b/cover-thumbnailer.py
@@ -693,8 +693,9 @@ if __name__ == "__main__":
             thumbnail.save_thumb(OUTPUT_FILE, "PNG")
 
     #Picture folders
-    elif CONF['pictures_enabled'] and match_path(INPUT_FOLDER, CONF['pictures_paths']):
+    elif CONF['pictures_enabled']:
         picture_list = search_cover(INPUT_FOLDER)
+        print(INPUT_FOLDER)
         if len(picture_list) == 0:
             picture_list = search_pictures(INPUT_FOLDER)
             if len(picture_list) == 0:

And when I clear thumbnails then launch nautilus from command line, it prints this:

/tmp/gnome-desktop-file-to-thumbnail

So it looks like INPUT_FOLDER doesn't contain the real input folder but /tmp/gnome-desktop-file-to-thumbnail instead, and this break folders detection.

help / advise wanted on repurpose

Hello I`m looking for a program to change folder icons of images containing textures for 3d to their thumbnail icon.
these thumbnail icons always have revieuw as a name.

I`m not the best programmer in the world and whould apreciate anny advise you have on where to go to repurpase this.

video support

Probably with ffmpegthumbnailer

BTW thanks for this awesome project. It makes browsing your pictures such a breeze, no need to setup a bloated and broken image server... I can't live without it anymore!

Uninstall does not do full cleanup and causes graphical glitch

After installing and uninstalling cover-thunbnailer, several of the generated files (e.g. AlbumArtSmall.jpg) remained after the uninstallation. I removed the files, but I'm now getting some weird graphical glitches with certain folders such as Music and some subfolders. Attached a screenshot of what the affected folders look like. Any help to fix this would be appreciated - happy to provide more info.

image

Specs:

  • Fedora 36
  • GNOME 42.3.1
  • GNOME nautilus 42.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.