aseprite / aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)
https://www.aseprite.org
28.8k stars 5.75k forks source link

Thumbnails on file managers #834

Open dacap opened 8 years ago

dacap commented 8 years ago

It would be nice to show thumbnails of .aseprite files on OS X Finder, Windows Explorer, and whatever Ubuntu uses. (related to #321)

We provide external plugins here: https://www.aseprite.org/thumbnails/ (these can be installed freely without installing Aseprite).

rautesamtr commented 8 years ago

Notes on thumbnails on linux:

Generally there exists the Freedesktop Thumbnail Managing Standard which should be followed. In short thumbails are kept in the $XDG_CACHE_HOME/thumbnails which defaults to ~/.cache/thumbnails if $XDG_CACHE_HOME is not set. There are two thumbnail sizes, large (256x256) and small (128x128). Files are png with some extra attributes like path to original file and last modified. The filename is a md5 hash on the uri of the original file.

To get a thumbnail generator on Ubuntu/Gnome you just have to write a entry file in .../share/thumbnailers here as example of evince thumbnailer for pdf:

[Thumbnailer Entry]
TryExec=evince-thumbnailer
Exec=evince-thumbnailer -s %s %u %o
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;

KDE seems to use something similar located in .../share/kservices5/

Short solution for this probably is to extend aseprites command line mode with a xdg thumbnailer mode, which would solve thumbnail generation outside of the app usage. Those thumbnailers normally are only called when a folder containing the files to be thumbnailed is opened with the file browser.

So there is still need to handle thumbnail generation from within aseprite when using a native linux file dialog. Ignoring KDE as target platform, it is the possibility to just use GnomeDesktopThumbnailFactory for thumbnail management but that creates a dependencie on libgnome-desktop.

Then there is also tumbler which makes thumbnail management available over dbus according to this spec draft. While sounding nice, it seems to be the only thumbnailer that implements those so far.

But it is probably best to implement a independent thumbnail management in aseprite to prevent having any strong platform specific (Gnome, KDE, XFCE etc..) dependencies.

elvisish commented 7 years ago

Hows this going for windows?

dacap commented 7 years ago

@elvisish I'm not working on this at the moment, but I might give some priority to this (I'd love to see thumbnails on Windows File Explorer and macOS Finder too)

hadess commented 7 years ago

To create a thumbnailer for GNOME, LinuxMint and MATE, you just need to create a binary that can transform the file to a PNG, and a file to declare how it's called.

See the Description section of: https://developer.gnome.org/gnome-desktop3/stable/GnomeDesktopThumbnailFactory.html which explains how to create those files, and where they should be installed.

dacap commented 6 years ago

I'm working on this one for Windows as first step (I already have something working in my local copy). It needs some cleanup and will upload the changes soon.

elvisish commented 6 years ago

Really looking forward to it!

dacap commented 6 years ago

I've just released a little beta to get thumbnails on Windows Explorer (this should be included with Aseprite in a near future version):

https://www.aseprite.org/thumbnails/

Commit: 1898ce2886415e310d4e0177fa6104c4a026eb00

elvisish commented 6 years ago

@dacap thanks for that! I just tried it, and I'm still getting the aseprite logo. I have SageThumbs installed to show Photoshop thumbnails, is there any known conflicts between this and SageThumbs? Also, does windows need restarting? I'm on Windows 7 x64.

dacap commented 6 years ago

I don't know SageThumb. It might have some kind of conflict because Photoshop use .ase as one of their file format. Try renaming to .aseprite and see if the thumbnail appears or restart windows just in case then.

elvisish commented 6 years ago

For both .ase and .aseprite, it just has the default aseprite logo. I'll try restarting...

elvisish commented 6 years ago

Tried restarting, still just shows the default logo; SageThumbs doesn't actually have .ase listed as one of it's file types, so I'm not sure it's even enforcing a thumbnail. @dacap can you confirm it works on Windows 7?

elvisish commented 6 years ago

Hmm, it still isn't showing. Neither .ase nor .aseprite are listed in SageThumbs as extensions, so I'm not sure it's actually enforcing any thumnbails itself. Can you confirm it works on Windows 7?

elvisish commented 6 years ago

I'm still not able to see thumbnails but I need SageThumbs for Photoshop thumbnails and I'm unsure if it's clashing or just my problem. Is there any way of manually generating thumbnails?

dacap commented 6 years ago

@elvisish can you uninstall sagethumbs temporally and try my extension to check if it works? In other case, try using the .aseprite extension in your files instead of .ase