summaryrefslogtreecommitdiff
path: root/tumbler/tumbler-file-info.c
Commit message (Collapse)AuthorAgeFilesLines
* i18n: Add missing initializationHEADmasterGaël Bonithon2022-03-171-0/+6
|
* Use microsecond precision for last modification timeGaël Bonithon2021-12-211-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Define error messages in `tumbler/tumbler-error.h`Gaël Bonithon2021-12-171-1/+1
|
* Store min length value.Nick Schermer2013-05-051-3/+5
|
* Avoid unref of null object.Nick Schermer2011-10-281-2/+5
|
* Get rid of the inherently broken GStrv type in function signatures.Jannis Pohlmann2011-02-131-3/+3
| | | | This breaks the API but it is not finalized anyway yet.
* Allow TumblerFileInfos to be created with empty URIs/MIME types.Jannis Pohlmann2010-02-261-2/+2
| | | | | | | | | 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>.
* Report unsupported flavors back to clients via an error signal.Jannis Pohlmann2010-01-071-2/+3
| | | | Thanks to Philip for the original commit.
* Fix a bunch of compiler warnings.Jannis Pohlmann2009-10-271-5/+1
|
* Remove obsolete provider files. Fix include in tumbler-file-info.c.Jannis Pohlmann2009-10-271-11/+8
|
* Massive refactoring to support flavors properly.Jannis Pohlmann2009-10-271-36/+148
| | | | | | | | | | | | | | | | | | | | | 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.
* Switch to a plugin API that only allows one cache backend at a time.Jannis Pohlmann2009-10-261-53/+31
| | | | | | | | | | | | | 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.
* Fix two memory leaks. Cleanup indentations.Jannis Pohlmann2009-09-121-0/+2
|
* Cleanup, remove private structs and use G_DEFINE_TYPE where possible.Jannis Pohlmann2009-06-171-65/+28
| | | | This commit also contains a few fixes though.
* No thumbnails for thumbnails. Allow Unqueue in the middle of requests.Jannis Pohlmann2009-06-121-10/+24
| | | | | | | | | | | 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.
* Add plugin interface for cache and thumbnailer implementations.Jannis Pohlmann2009-06-081-0/+376
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.