summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaël Bonithon <gael@xfce.org>2021-12-22 19:15:55 +0100
committerGaël Bonithon <gael@xfce.org>2021-12-22 19:20:25 +0100
commitf0bc4cc996c8363d92180c9f60d9e6f1ad1cf7b2 (patch)
tree86ad4b110ba34f7e86eaa6453aea3c6321db21dd
parent9bd5c1084f3014ed059b8726b0df77d1b2957c94 (diff)
downloadtumbler-f0bc4cc996c8363d92180c9f60d9e6f1ad1cf7b2.tar.gz
Fix mistake in previous commit
I took the exception for the rule: let's hope this time it's good.
-rw-r--r--plugins/cover-thumbnailer/cover-thumbnailer.c8
-rw-r--r--tumbler/tumbler-util.c7
-rw-r--r--tumbler/tumbler-util.h2
3 files changed, 10 insertions, 7 deletions
diff --git a/plugins/cover-thumbnailer/cover-thumbnailer.c b/plugins/cover-thumbnailer/cover-thumbnailer.c
index 3009215..e36deff 100644
--- a/plugins/cover-thumbnailer/cover-thumbnailer.c
+++ b/plugins/cover-thumbnailer/cover-thumbnailer.c
@@ -305,7 +305,7 @@ cover_thumbnailer_load_perform (CoverThumbnailer *cover,
static GdkPixbuf *
cover_thumbnailer_load_pixbuf (CoverThumbnailer *cover,
const gchar *url,
- TumblerThumbnailFlavor *flavor,
+ TumblerThumbnail *thumbnail,
GCancellable *cancellable,
GError **error)
{
@@ -317,7 +317,7 @@ cover_thumbnailer_load_pixbuf (CoverThumbnailer *cover,
g_return_val_if_fail (url != NULL, NULL);
g_return_val_if_fail (G_IS_CANCELLABLE (cancellable), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- g_return_val_if_fail (TUMBLER_IS_THUMBNAIL_FLAVOR (flavor), NULL);
+ g_return_val_if_fail (TUMBLER_IS_THUMBNAIL (thumbnail), NULL);
if (g_cancellable_is_cancelled (cancellable))
return NULL;
@@ -325,7 +325,7 @@ cover_thumbnailer_load_pixbuf (CoverThumbnailer *cover,
/* create a pixbuf loader */
loader = gdk_pixbuf_loader_new ();
g_signal_connect (loader, "size-prepared",
- G_CALLBACK (tumbler_util_size_prepared), flavor);
+ G_CALLBACK (tumbler_util_size_prepared), thumbnail);
/* download the image into a pixbuf loader */
curl_handle = cover_thumbnailer_load_prepare (cover, url, cancellable);
@@ -635,7 +635,7 @@ cover_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
if (poster_url != NULL)
{
/* download poster and load it in a pixbuf */
- pixbuf = cover_thumbnailer_load_pixbuf (cover, poster_url, flavor, cancellable, &error);
+ pixbuf = cover_thumbnailer_load_pixbuf (cover, poster_url, thumbnail, cancellable, &error);
g_free (poster_url);
}
}
diff --git a/tumbler/tumbler-util.c b/tumbler/tumbler-util.c
index 046b42e..9d6fad0 100644
--- a/tumbler/tumbler-util.c
+++ b/tumbler/tumbler-util.c
@@ -173,16 +173,19 @@ void
tumbler_util_size_prepared (GdkPixbufLoader *loader,
gint source_width,
gint source_height,
- TumblerThumbnailFlavor *flavor)
+ TumblerThumbnail *thumbnail)
{
+ TumblerThumbnailFlavor *flavor;
gdouble hratio, wratio;
gint dest_width, dest_height;
g_return_if_fail (GDK_IS_PIXBUF_LOADER (loader));
- g_return_if_fail (TUMBLER_IS_THUMBNAIL_FLAVOR (flavor));
+ g_return_if_fail (TUMBLER_IS_THUMBNAIL (thumbnail));
/* get the destination size */
+ flavor = tumbler_thumbnail_get_flavor (thumbnail);
tumbler_thumbnail_flavor_get_size (flavor, &dest_width, &dest_height);
+ g_object_unref (flavor);
if (source_width <= dest_width && source_height <= dest_height)
{
diff --git a/tumbler/tumbler-util.h b/tumbler/tumbler-util.h
index c55245d..be030cc 100644
--- a/tumbler/tumbler-util.h
+++ b/tumbler/tumbler-util.h
@@ -37,7 +37,7 @@ gboolean tumbler_util_guess_is_sparse (TumblerFileInfo *info);
void tumbler_util_size_prepared (GdkPixbufLoader *loader,
gint source_width,
gint source_height,
- TumblerThumbnailFlavor *flavor);
+ TumblerThumbnail *thumbnail);
GdkPixbuf *tumbler_util_scale_pixbuf (GdkPixbuf *source,
gint dest_width,