[totem] thumbnailer: Make --size XX --raw work
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] thumbnailer: Make --size XX --raw work
- Date: Sat, 26 Feb 2011 01:44:23 +0000 (UTC)
commit 160feea564c4789b02b278802bafbc5f7265f790
Author: Bastien Nocera <hadess hadess net>
Date: Sat Feb 26 01:42:00 2011 +0000
thumbnailer: Make --size XX --raw work
https://bugzilla.gnome.org/show_bug.cgi?id=621802
src/totem-video-thumbnailer.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index 8e497f1..cb235dd 100644
--- a/src/totem-video-thumbnailer.c
+++ b/src/totem-video-thumbnailer.c
@@ -277,11 +277,9 @@ scale_pixbuf (GdkPixbuf *pixbuf, int size, gboolean is_still)
{
GdkPixbuf *result;
int width, height;
+ int d_width, d_height;
- if (size <= 256) {
- int d_width, d_height;
- GdkPixbuf *small;
-
+ if (size != -1) {
height = gdk_pixbuf_get_height (pixbuf);
width = gdk_pixbuf_get_width (pixbuf);
@@ -292,6 +290,12 @@ scale_pixbuf (GdkPixbuf *pixbuf, int size, gboolean is_still)
d_height = size;
d_width = size * width / height;
}
+ } else {
+ d_width = d_height = -1;
+ }
+
+ if (size <= 256) {
+ GdkPixbuf *small;
small = gdk_pixbuf_scale_simple (pixbuf, d_width, d_height, GDK_INTERP_BILINEAR);
@@ -307,7 +311,10 @@ scale_pixbuf (GdkPixbuf *pixbuf, int size, gboolean is_still)
result = add_holes_to_pixbuf_large (pixbuf, size);
g_return_val_if_fail (result != NULL, NULL);
} else {
- result = g_object_ref (pixbuf);
+ if (size > 0)
+ result = gdk_pixbuf_scale_simple (pixbuf, d_width, d_height, GDK_INTERP_BILINEAR);
+ else
+ result = g_object_ref (pixbuf);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]