Prototype thumbnailer now has a Epeg plugin
Philip Van Hoof
spam at pvanhoof.be
Mon Oct 27 05:38:03 PDT 2008
Hi there,
I implemented a plugin that uses Carsten's Epeg library to create
thumbnails of Jpeg files[3].
Regretfully because the thumbnail-spec requires PNG files I could not
use Epeg's own epeg_file_output_set and epeg_encode.
I also think it should be noted that thumbnails as PNG files are some-
times going to be larger than the original, in case the original was
written as for example a Jpeg.
An argument can be made that most filesystems have a pre defined
cluster-size anyway and that therefore most thumbnails will consume
~ 32kb each.
However
For small filesystems usually a smaller cluster size is picked [1].
Meaning that thumbnails of ~ 2kb will consume 4kb or 8kb depending on
the partition's size. Not 22kb like what the average size for a 128x128
PNG file is.
On modern camera's the camera itself might not store thumbnails, but a
desktop using the .localthumbs specification [2] might attempt to store
in that (indeed) read-only location (something or somebody has to write
it, else it's pointless to spec it - so let's assume something does -).
Other arguments that can be made pro small files is that they'll load
faster and that the implementation of a mobile device could do something
like this:
mount -o loop -t reiserfs thumbnails.img /home/user/.thumbnails
And then periodically
resize_reiserfs thumbnails.img +100K
I'm not trying to say ReiserFS is the most ideal filesystem for this,
just pointing out that ReiserFS does solve the "too small files" issue
and that mobile devices that might implement their root FS this way,
shouldn't be neglected while making a spec.
Yet another argument against PNG and pro JPEG for thumbnails is that
apparently some vendors have Jpeg libraries and support for Jpeg in
hardware-ish things. Making it faster to render those things.
So I wonder if PNG as format is the right decision for thumbnail-spec[4]
[1] http://support.microsoft.com/kb/192322
[2] http://jens.triq.net/thumbnail-spec/local.html
[3] https://stage.maemo.org/svn/maemo/projects/haf/trunk/hildon-thumbnail/daemon/plugins/epeg-plugin.c
[4] http://jens.triq.net/thumbnail-spec
--
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
http://pvanhoof.be/blog
http://codeminded.be
More information about the xdg
mailing list