| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the file system allows it, this prevents Tumbler from believing
that the original file has not been modified since the last time the
thumbnail was created, when in fact modifications have taken place in
the second that the thumbnail was created.
The time of last modification is stored internally in a `gdouble`, and
written to the PNG thumbnail in `%.6f` format. This complies well with
the Freedesktop specification [1], as the stat command returns this
format when invoked as `stat -c%.6Y file`, although it is likely that
the specification was written with the idea that this value be an
integer.
The extraction of the thumbnail information is done via
`g_ascii_strtod()`, so an integer or less precision is not a problem. As
for a code expecting to find an integer, it is likely to simply ignore
the decimal part, as Tumbler used to do by extracting the information
via `atol()`. It is possible, however, that an error will be found if a
more complete extractor is used, such as `strtol()`.
The changes this causes to the exposed Tumbler APIs should also be
inconsequential, as it is a conversion to a higher type. This should
therefore result in implicit conversions, except perhaps for
`tumbler_file_info_get_mtime()`, if its return value is explicitly
stored in a `gint64`.
[1] https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#CREATION
Fixes #15, see !20 for more details.
|
| |
|
| |
|
| |
|
|
|
|
| |
This breaks the API but it is not finalized anyway yet.
|
|
|
|
|
|
|
|
|
| |
This is done to avoid warnings when someone forgets to send a MIME type
along with a thumbnail request etc. For empty URIs/MIME types, tumbler
will not find a thumbnailer and the broken elements will be reported
back to the client via the "Error" signal.
The original idea came from Philip Van Hoof <philip@codeminded.be>.
|
|
|
|
| |
Thanks to Philip for the original commit.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor the entire code to use TumblerFileInfo instead of separate
URI/MIME/flavor arrays. We now support flavors which means that
applications can request "normal" and "large" thumbnails and thus have
more control over what is created. This simplifies the code in a lot of
places. We now use a real GObject class called TumblerThumbnailFlavor
instead of a fixed-size enum. Cache backends can return as many flavors
as they want, each consisting of a name, a width and a height. As a
consequence, we can also get rid of the configure flags to
enable/disable normal, large and cropped thumbnails. The default cache
plugin shipped with Tumbler only supports "normal" (128x128px) and
"large" (256x256px).
Optimize the code a little bit. We now load the TunarFileInfo and
ThunarThumbnail only *once* for each URI instead of loading them once in
the scheduler and again in thumbnailer plugins.
This needs careful testing. I might have introduced a few memory leaks
here and there, plus new bugs... you never know.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tumbler will now only check for the file
$(libdir)/tumbler-1/plugins/cache/tumbler-cache-plugin.so
which is supposed to link to the cache backend that is being used. If
the XDG cache is built, tumbler-cache-plugin.so is set up to link to
this plugin.
The fact that we only have a singleton cache makes things much less
ambiguous.
|
| |
|
|
|
|
| |
This commit also contains a few fixes though.
|
|
|
|
|
|
|
|
|
|
|
| |
There's a new method tumbler_cache_is_thumbnail() now which has to
be implemented by plugins. It is used by TumblerFileInfo in
tumbler_file_info_load() to check whether the file is a thumbnail
itself. In that case, tumbler_file_info_load() will fail with
a TUMBLER_ERROR_IS_THUMBNAIL error.
Add another check in TumblerThresholdScheduler to make unqueuing
requests in the middle of the process work.
|
|
This is a major refactoring of the source code. Amongst others, the
classes TumblerProviderFactory, TumblerThumbnailer,
TumblerAbstractThumbnailer, TumblerThumbnailerProvider, TumblerCache,
TumblerCacheProvider and TumblerFileInfo have been added.
From now on tumbler supports different storage backends and thumbnailers
as plugins. Storage backends have to implement TumblerCache,
thumbnailers have to implement TumblerThumbnailer.
Plugins have to implement three methods: tumbler_plugin_initialize(),
tumbler_plugin_shutdown() and tumbler_plugin_get_types(). The latter
is expected to return a list of provider types for cache or thumbnailer
implementations.
Two example plugins have been added, one for the XDG thumbnail cache
and one for a GdkPixbuf based thumbnailer.
The code of tumblerd was updated to reflect these changes in libtumbler.
|