algoo / preview-generator

generates previews of files with cache management
https://pypi.org/project/preview-generator/
MIT License
228 stars 50 forks source link

[discussion] TIL about /usr/share/thumbnailers #162

Closed JulienPalard closed 3 years ago

JulienPalard commented 4 years ago

It could be an interesting source of information about which Debian package can convert what:

$ apt-file search /usr/share/thumbnailers
atril-common: /usr/share/thumbnailers/atril.thumbnailer
blender-data: /usr/share/thumbnailers/blender.thumbnailer
dia-common: /usr/share/thumbnailers/dia.thumbnailer
evince: /usr/share/thumbnailers/evince.thumbnailer
exe-thumbnailer: /usr/share/thumbnailers/exe-dll-msi.thumbnailer
ffmpegthumbnailer: /usr/share/thumbnailers/ffmpegthumbnailer.thumbnailer
geogebra-gnome: /usr/share/thumbnailers/geogebra.thumbnailer
gnome-font-viewer: /usr/share/thumbnailers/gnome-font-viewer.thumbnailer
gnome-hwp-support: /usr/share/thumbnailers/hwp-thumbnailer.thumbnailer
gnome-nds-thumbnailer: /usr/share/thumbnailers/gnome-nds-thumbnailer.thumbnailer
gwyddion-common: /usr/share/thumbnailers/gwyddion.thumbnailer
heif-thumbnailer: /usr/share/thumbnailers/heif.thumbnailer
libgdk-pixbuf2.0-bin: /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer
libgsf-bin: /usr/share/thumbnailers/gsf-office.thumbnailer
librsvg2-common: /usr/share/thumbnailers/librsvg.thumbnailer
mate-control-center-common: /usr/share/thumbnailers/mate-font-viewer.thumbnailer
mcomix: /usr/share/thumbnailers/comicthumb.thumbnailer
mypaint: /usr/share/thumbnailers/mypaint-ora.thumbnailer
ooo-thumbnailer: /usr/share/thumbnailers/ooo.thumbnailer
pentobi: /usr/share/thumbnailers/pentobi.thumbnailer
renderdoc: /usr/share/thumbnailers/renderdoc.thumbnailer
tiled: /usr/share/thumbnailers/tiled.thumbnailer
totem-common: /usr/share/thumbnailers/totem.thumbnailer

We typically learn about ooo-thumbnailer:

Description: thumbnailer for OpenOffice.org documents
 ooo-thumbnailer is a lightweight OpenOffice.org document thumbnailer that can
 be used by Nautilus to create thumbnails for your documents, spreadsheets,
 presentations and drawings.

Those files looks like this:

[Thumbnailer Entry]
TryExec=atril-thumbnailer
Exec=atril-thumbnailer -s %s %u %o
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;application/postscript;application/x-bzpostscript;application/x-gzpostscri
pt;image/x-eps;image/x-bzeps;image/x-gzeps;application/x-dvi;application/x-bzdvi;application/x-gzdvi;image/vnd.djvu;image/vnd.djvu+multipage;image/tiff;application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/vnd.comicbook+zip;application/vnd-comicbook.rar;image/*;application/oxps;application/vnd.ms-xpsdocument;                                                                                                                                         

File managers typically use it (thunar, nemo, pcmanfm, ...) maybe exclusively via https://developer.gnome.org/gnome-desktop/stable/GnomeDesktopThumbnailFactory.html, like nemo.

inkhey commented 4 years ago

Thanks @JulienPalard, That's really interesting.

First that give use idea of new type of image preview we can do with preview_generator. I have not think about preview exe file, font file, etc.. we should also check about comic file format.

Secondly, we can imagine having a image-only builder based on this kind of Thumbnailer Entry. We set somewhere path of thumbnailer dir (by default /usr/share/thumbnailers) and our process read the available thumbnails and load config to use them to build preview of many mimetype. I'm not sure that a good idea to rely on gnome code there to get thumbnails there, thumbnailer file are simple enough for support of them to be implemented in preview_generator without real issue.

Now i see some issue with this idea of thumbnailer builder with current preview-generator code :

  1. choose of thumbnailer in builder itself ? Which thumbnailer to choose if both totem-common and ffmpegthumbnailer can handle preview for .mp4 (we consider we remove our current ffmpeg builder)
  2. thumbnailer builder should be less prioritary than current one. for exemple ffmpegthumbnailer should not be used if our multipage ffmpeg builder is loaded . We currently doesn't have such priority mecanism (that a known issue, see https://github.com/algoo/preview-generator/issues/159)
  3. as this builder will be image only, we need to be able to rely on other builder for other type of preview ( idem, known issue : https://github.com/algoo/preview-generator/issues/159).

I do think 2 is the really blocking point.

inkhey commented 3 years ago

replaced by #247