Feature request: gnome-thumbnailer: expose thumbnail_failed_path to world
Hello guys,
could you please make thumbnail_failed_path()
not a static, just by analogy with gnome_desktop_thumbnail_path_for_uri()
Particularly it would be helpful for a quick checking of previous thumbnailing failures without the need to duplicate existing code of libgnome-desktop...
Thanks
UPD
maybe, something like this:
--- a/gnome-desktop-thumbnail.c 2018-12-16 16:12:15.190600842 +1000
+++ b/gnome-desktop-thumbnail.c 2018-12-16 16:19:38.892401985 +1000
@@ -1268,6 +1268,26 @@
}
/**
+ * gnome_desktop_thumbnail_failed_path_for_uri:
+ * @uri: an uri
+ * @size: a thumbnail size
+ *
+ * Returns the filename that a thumbnail of size @size for @uri would have
+ * in case of thumbnailing failure.
+ * This function is threadsafe and does no blocking I/O.
+ *
+ * Return value: an absolute filename
+ *
+ * Since: 2.xx
+ **/
+char *
+gnome_desktop_thumbnail_failed_path_for_uri (const char *uri,
+ GnomeDesktopThumbnailSize size)
+{
+ return thumbnail_failed_path (uri);
+}
+
+/**
* gnome_desktop_thumbnail_is_valid:
* @pixbuf: an loaded thumbnail #GdkPixbuf
* @uri: a uri
--- a/gnome-desktop-thumbnail.h 2018-12-16 16:20:42.392554260 +1000
+++ b/gnome-desktop-thumbnail.h 2018-12-16 16:16:20.408450242 +1000
@@ -91,12 +91,15 @@
/* Thumbnailing utils: */
+typedef char * (*ThumbnailPathBuilder) (const char *uri, GnomeDesktopThumbnailSize);
+
gboolean gnome_desktop_thumbnail_is_valid (GdkPixbuf *pixbuf,
const char *uri,
time_t mtime);
char * gnome_desktop_thumbnail_path_for_uri (const char *uri,
GnomeDesktopThumbnailSize size);
-
+char * gnome_desktop_thumbnail_failed_path_for_uri(const char *uri,
+ GnomeDesktopThumbnailSize size);
G_END_DECLS
#endif /* GNOME_DESKTOP_THUMBNAIL_H */
Edited by Just Me