There is a way of getting this done explained in the Floorplanner Tech Blog. To compile dump-gnash on a fresh Maverick you'll need
sudo apt-get install gcc libboost-dev libboost-thread-dev libagg-dev libsdl1.2-dev libcairo-dev libgstreamer0.10-dev libatk1.0-dev libglib2.0-dev libpango1.0-dev libgtk2.0-dev libgtkglext1-dev libgl1-mesa-dev libgif-dev libjpeg-dev libgstreamer-plugins-base0.10-dev libspeex-dev libcurl-dev
And then you just follow the steps. This will take a long time.
NOTE: For Step 7 use the following script instead:
if [[ $3 ]]; then
raw="$(mktemp)"
dump-gnash $2 -P "FlashVars=url=file://$1" -D "$raw" --max-advances 1 -j 500 -k 500
tail -c 1MB "$raw" | convert -size 500x500 -depth 8 rgba:- -separate -swap 0,2 -combine -trim png:"$3"
trap "rm $raw" EXIT
else
echo "Insufficient arguments (expected 3 arguments)"
exit 1
fi
Once you have the final script running you just hook it into gconf-editor
gconftool-2 -s "/desktop/gnome/thumbnailers/application@swf" -t string "/usr/bin/swfthumbnailer.sh %s %i %o"
gconftool-2 -s "/desktop/gnome/thumbnailers/application@swf/enable" -t boolean 'true'
gconftool-2 -s "/desktop/gnome/thumbnailers/application@x-swf" -t string "/usr/bin/swfthumbnailer.sh %s %i %o"
gconftool-2 -s "/desktop/gnome/thumbnailers/application@x-swf/enable" -t boolean 'true'
gconftool-2 -s "/desktop/gnome/thumbnailers/application@x-shockwave-flash/command" -t string "/usr/bin/swfthumbnailer.sh %s %i %o"
gconftool-2 -s "/desktop/gnome/thumbnailers/application@x-shockwave-flash/enable" -t boolean 'true'
Then restart (or restart gnome-settings-daemon), and you've got swf thumbs!
P.S.: This is a huge hack. A better way to do this would be vastly appreciated.
It seems for an icon theme to let Nautilus display the contents of plain text files as thumbnails, its sub-directory for mime types, which might be named, for example, mimes or mimetypes should have a file named text-x-preview.icon (along with an icon file named text-x-preview.png or text-x-preview.svg, etc. serving as a backdrop for the file contents thumbnail), which is actually a plain text file including settings for the thumbnail, in each sub-directory for different icon sizes (for example, 22, 24, 48).
For example, I have added ~/.local/share/icons/Nitrux/mimetypes/48/text-x-preview.icon
(imported from the default Humanity icon theme) to my current icon theme, and only then it has begun displaying thumbnails for plain text files, which has the following content:
[Icon Data]
EmbeddedTextRectangle=180,100,680,900
AttachPoints=750,750|750,250|250,250|250,750
I'll hopefully try and add more information about the settings above in due course.
- It seems having text-x-preview.icon and text-x-preview.svg (or another valid image file type) in the sub-directory for size 48px allows Nautilus to display thumbnails for all sizes from 48px upwards, but not for sizes below 48px, for which you also need text-x-preview.icon and text-x-preview.svg (or another valid image file type) at least in the sub-directories for sizes 22px and 24px (this lets Nautilus to display thumbnails also for 16px in some but not all icon themes).
These two files in the Humanity icon theme have exactly the same content:
[Icon Data]
EmbeddedTextRectangle=180,100,680,900
NOTE: Unfortunately this whole thing no longer works under Ubuntu 15.04
Best Answer
Digging up further (and researching a LOT), I figured it out:
About image thumbnailers: It seems that Nautilus uses
libgnome-desktop
for thumbnail management, and the latter useslibgdk-pixbuf
to handle file types that have no external handler in/usr/share/thumbnailers
. So the "basic" image types are ultimately handled by GnomeDesktopThumbnailFactory and GdkPixbuf (references shown for versions shipped in Ubuntu 12.04). And the formats it handles can be inspected using thegdk-pixbuf-query-loaders
tool. In my system this means:So these are the "internal" thumbnailers. And it does include
xpm
files. So something was wrong with my particular files instead.And indeed the files were not standard, they had a copyright note prior to the
/* XPM *
header:Once comments were removed, thumbnails were generated just file.
It is curious that even with the "invalid" header the default Image Viewer in Gnome ("Eye of The Gnome", or
eog
) was able to display the files! So either files are not actually invalid, or kudos toeog
for being able to open them! Anyway, since it is possible to open, andeog
usesgdk-pixbuf
too, I've filled a bug inlibgnome-desktop
requesting that thumbnailers be generated for such non-standardxpm
files. Any help promoting the bug is appreciated!Also, some notes about my research:
ThumbnailerSpec is mentioned in several places as the specification for "external thumbnailers". But it has nothing to do with this! It talks about using D-Bus for thumbnailers management, and nothing indicates that such spec is actually implemented in Gnome.
Actually, I was unable to find any official spec on the implemented behavior of "saving a
.thumbnailer
file with[Thumbnailer Entry]
and .desktop-esque format to/usr/share/thumbnailers
". Bug 636819 is cited a lot as a source, but it only describes that behavior was changed in Gnome2->Gnome3 transition, and it no longer usesgconf
to store external thumbnailers.It looks like there is no spec at all. This obsolete documentation is still the only official reference, for example, on what
%i %o %u %s
means.And the only "official" place announcing the change from
gconf
to/usr/share/thumbnailers
, other than hunting down the source code commit that did it, is this seemingly ordinary bug report.