summaryrefslogtreecommitdiff
path: root/tumbler/tumbler-thumbnailer.c
Commit message (Collapse)AuthorAgeFilesLines
* desktop-thumbnailer: Allow to override configuration in desktop filesGaël Bonithon2021-12-291-12/+2
| | | | | | | The "X-Tumbler Settings" group is searched in each desktop file with the same keys as in `tumbler.rc`, where the default configuration is now. Closes #52.
* Try all available thumbnailers before declaring failureGaël Bonithon2021-12-291-12/+19
| | | | | | | | | | | | | The request thumbnailer array no longer contains one thumbnailer per URI, but the list of available thumbnailers for this URI (after applying the filters of the configuration file), sorted by priority. For a given URI, we browse the thumbnailer list until we succeed in generating a thumbnail. An error signal is only issued if the last thumbnailer has failed. Intermediate errors are only displayed if debug logging is enabled. Closes #50.
* Error handling: Fit to the spec and complete message if neededGaël Bonithon2021-12-261-2/+3
| | | | | | | | | | | | | A parameter is added to Tumbler's internal error signals to account for the error domain, and the error code `TUMBLER_ERROR_OTHER_ERROR_DOMAIN` is added to indicate that the error originated from a third-party API. When sending the error signal via D-Bus, cancelling errors are filtered out, and when the error originates from a third-party API, the error message is prefixed with the domain and code of that error, in a possibly parsable format. Fixes #49.
* Fix compilation warningsGaël Bonithon2021-11-101-32/+3
|
* This commit implements Excludes pathsAli Abdallah2020-05-011-6/+26
| | | | | Any path found in a plugin Excludes will be ignored, code contributed by Markus Kolb xfce@tower-net.de Bug #16130.
* Fix memory corruption on 64bit (bug #9766).Nick Schermer2013-05-051-1/+1
|
* Add some additional debug checks.Nick Schermer2013-05-041-0/+3
|
* Add config file system to control thumbnailing plugin.Nick Schermer2012-12-271-1/+73
| | | | | | Settings that allow to change the plugin priority, max file size to act on, white-listed locations or completely disable them.
* Fix compiler error on Sun Studio.Nick Schermer2011-03-281-3/+3
|
* Get rid of the inherently broken GStrv type in function signatures.Jannis Pohlmann2011-02-131-8/+8
| | | | This breaks the API but it is not finalized anyway yet.
* Use LGPL instead of GPL license headers in the library (bug #6781).Jannis Pohlmann2010-11-061-9/+9
|
* Fix a few memory leaks.Jannis Pohlmann2009-11-231-0/+2
|
* Support specialized thumbnailers and overrides files properly.Jannis Pohlmann2009-11-161-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | This required some major changes, most of which are documented in the source code. It still needs to be tested but it should be fine. The mutex locks in TumblerManager could probably be optimized and some other parts are not optimal with regards to speed and memory usage yet. All in all, what's done now is: - overrides files are parsed into override info structs and kept in a (hashkey -> override info list) hash table - each of these override info lists is sorted in the order of the directories the overrides files are located in (with higher priority directories coming first) - the first override info in each list determines which specialized thumbnailer is set as preferred for the corresponding hash key in the registry - thumbnailer service files are parsed into thumbnailer info structs and kept in a (basename -> thumbnailer info list) hash table - each of these thumbnailer info lists is sorted in the order of the directories the thumbnailer service infos come from - the first thumbnailers in each list are added to the registry - whenever something changes on the disk, this internal representation is updated
* Massive refactoring to support flavors properly.Jannis Pohlmann2009-10-271-15/+11
| | | | | | | | | | | | | | | | | | | | | 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.
* Added the DBus API parts for flavor supportPhilip Van Hoof2009-10-261-2/+4
| | | | Signed-off-by: Jannis Pohlmann <jannis@xfce.org>
* Add cancel capability to the thumbnail operations.Philip Van Hoof2009-10-141-3/+5
|
* Cleanup, remove private structs and use G_DEFINE_TYPE where possible.Jannis Pohlmann2009-06-171-12/+15
| | | | This commit also contains a few fixes though.
* Add plugin interface for cache and thumbnailer implementations.Jannis Pohlmann2009-06-081-0/+224
| | | | | | | | | | | | | | | | | | | | | 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.
* Add tumbler utility library, rename the service to tumblerd.Jannis Pohlmann2009-05-211-224/+0
| | | | | | | | | There's a library called tumbler (or tumbler-1) now which provides utility classes and functions for writing specialized thumbnailers. The libary is LGPL while the D-Bus service itself is GPL. The tumbler service was renamed to tumblerd and the marshallers were moved into the library.
* Fix last element not being copied in tumbler_thumbnailer_array_copy().Jannis Pohlmann2009-05-211-3/+3
|
* Implement tumbler_service_queue() based on TumblerSchedulerRequest.Jannis Pohlmann2009-05-201-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | When an org.freedesktop.thumbnailer.Generic.Queue request is sent to TumblerService, it does three things: 1. It requests a TumblerThumbnailer array from its TumblerRegistry. This array has the same length as the URIs and mime hints arrays passed to org.freedesktop.thumbnailer.Generic.Queue. The Nth thumbnailer in the array is responsible for generating the thumbnailer for the Nth URI. 2. It allocates a TumblerSchedulerRequest. 3. It asks the TumblerScheduler to push the request. Amongst others, the following functions were added in this commit: - tumbler_registry_get_thumbnailer_array() - tumbler_registry_lookup() (private function) - tumbler_scheduler_request_new() - tumbler_schedulre_request_free() - tumbler_thumbnailer_array_copy() - tumbler_thumbnailer_array_free()
* Implement thumbnailer management in TumblerRegistry.Jannis Pohlmann2009-05-191-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a (gchar *) to (GList **) hash table for managing thumbnailers in TumblerRegistry. For each so-called hash key (a combination of an URI scheme and a MIME type, e.g. "file-image/png") we store a list of registered thumbnailers. Only the first thumbnailer in this list will ever be used. The others can move forward in the list when a thumbnailer is unregistered. The order in which thumbnailers are inserted into a list is defined as follows: - thumbnailers registered dynamically over D-Bus go before anything else. The thumbnailer registered latest goes first. - specialized thumbnailers with most recent service files go first. - built-in thumbnailers are always at the end of the list in the order they were added to the registry. Connect to the new "unregister" signal of all TumblerThumbnailers to remove them when required. The signal is only emitted by TumblerSpecializedThumbnailers when their proxy is destroyed. TumblerSpecializedThumbnailer has two new properties: "foreign" and "modified". Foreign thumbnailers are those registered dynamically over D-Bus (using org.freedesktop.thumbnailer.Manager.Register()). The "modified" property represents the timestamp of when the thumbnailer's .service file was last modified. It is 0 for foreign thumbnailers.
* Improve TumblerThumbnailer and add TumblerSpecializedThumbnailer.Jannis Pohlmann2009-05-181-2/+53
| | | | | | | | | | | | | | | | | | Add new properties "uri-schemes" and "hash-keys" to TumblerThumbnailer and add getter functions for all TumblerThumbnailer properties. Add URI schemes parameter to the TumblerBuiltinThumbnailer constructor and compute hash keys for built-in thumbnailers based on the provided URI schemes and mime types. Adds TumblerSpecializedThumbnailer which is created for each thumbnailer either found in $XDG_DATA_DIRS/thumbnailers/ or registered dynamically via org.freedesktop.thumbnailer.Manager.Register(). Internally it uses a DBusGProxy to talk to the specialized thumbnailer service. Add a GMutex to TumblerManager and lock all functions for now. Implement the Register() method which creates a new TumblerSpecializedThumbnailer and adds it to the registry.
* Introduce interfaces and classes for built-in thumbnailers.Jannis Pohlmann2009-05-171-0/+123
This commit introduces the TumblerThumbnailer interface which is supposed to be implemented twice, once for built-in thumbnailers that run in the same process as tumbler itself, and once for specialized thumbnailers which talk to tumbler over D-Bus. TumblerThumbnailer provides a function for creating a thumbnail plus "ready" and "error" signals. Their signatures may still change though. TumblerBuiltinThumbnailer is a new class for built-in thumbnailers. It is a little similar to ExoSimpleJob in that it allows built-in thumbnailers to be created by defining a create function and a list of mime types. Also new is tumbler_pixbuf_thumbnailer_new() which creates a pixbuf thumbnailer. It's just a skeleton for now. TumblerRegistry now has a method tumbler_registry_add() for adding a new TumblerThumbnailer to the registry. Last but not least, there's tumbler-marshal.list for custom marshallers now.