diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-02-20 19:43:21 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-02-20 21:14:33 +0100 |
commit | 04ec292caf2ec2aa1e6a694996fefa6ec3b5ff6b (patch) | |
tree | 98ae92f877537656d49e72d6ecdf0c1efcfd969a /fiv-thumbnail.c | |
parent | a28fbf25bcec03ae8cb8e6b22537883f78541d66 (diff) | |
download | fiv-04ec292caf2ec2aa1e6a694996fefa6ec3b5ff6b.tar.gz fiv-04ec292caf2ec2aa1e6a694996fefa6ec3b5ff6b.tar.xz fiv-04ec292caf2ec2aa1e6a694996fefa6ec3b5ff6b.zip |
Make thumbnailers pass back raw images
Diffstat (limited to 'fiv-thumbnail.c')
-rw-r--r-- | fiv-thumbnail.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fiv-thumbnail.c b/fiv-thumbnail.c index a57d016..328b105 100644 --- a/fiv-thumbnail.c +++ b/fiv-thumbnail.c @@ -230,7 +230,8 @@ save_thumbnail(cairo_surface_t *thumbnail, const char *path, GString *thum) } gboolean -fiv_thumbnail_produce(GFile *target, FivThumbnailSize max_size, GError **error) +fiv_thumbnail_produce(GFile *target, FivThumbnailSize max_size, + cairo_surface_t **max_size_surface, GError **error) { g_return_val_if_fail(max_size >= FIV_THUMBNAIL_SIZE_MIN && max_size <= FIV_THUMBNAIL_SIZE_MAX, FALSE); @@ -306,8 +307,12 @@ fiv_thumbnail_produce(GFile *target, FivThumbnailSize max_size, GError **error) gchar *path = g_strdup_printf("%s/wide-%s/%s.webp", thumbnails_dir, fiv_thumbnail_sizes[use].thumbnail_spec_name, sum); save_thumbnail(scaled, path, thum); - cairo_surface_destroy(scaled); g_free(path); + + if (!*max_size_surface) + *max_size_surface = scaled; + else + cairo_surface_destroy(scaled); } g_string_free(thum, TRUE); |