[maemo-commits] [maemo-commits] r16661 - in projects/haf/trunk/hildon-thumbnail: . daemon

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Nov 13 16:08:21 EET 2008
Author: pvanhoof
Date: 2008-11-13 16:08:20 +0200 (Thu, 13 Nov 2008)
New Revision: 16661

Modified:
   projects/haf/trunk/hildon-thumbnail/ChangeLog
   projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c
   projects/haf/trunk/hildon-thumbnail/daemon/utils.c
Log:
2008-11-13  Philip Van Hoof  <philip at codeminded.be>

	* daemon/utils.c: No more difference between png and jpeg filename
	request for cropped
	* daemon/hildon-thumbnail-plugin.c: Making it possible to dynamically
	change the output plugin's configuration



Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-thumbnail/ChangeLog	2008-11-13 13:59:46 UTC (rev 16660)
+++ projects/haf/trunk/hildon-thumbnail/ChangeLog	2008-11-13 14:08:20 UTC (rev 16661)
@@ -1,5 +1,12 @@
 2008-11-13  Philip Van Hoof  <philip at codeminded.be>
 
+	* daemon/utils.c: No more difference between png and jpeg filename
+	request for cropped
+	* daemon/hildon-thumbnail-plugin.c: Making it possible to dynamically
+	change the output plugin's configuration
+
+2008-11-13  Philip Van Hoof  <philip at codeminded.be>
+
 	* daemon/plugins/gdkpixbuf-png-out-plugin.c
 	* daemon/plugins/Makefile.am: Added a PNG output plugin, this plugin is
 	inactive by default (our default is JPEG, although indeed the FDO

Modified: projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c	2008-11-13 13:59:46 UTC (rev 16660)
+++ projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c	2008-11-13 14:08:20 UTC (rev 16661)
@@ -47,14 +47,8 @@
 			   module_name, 
 			   g_module_error ());
 	} else {
-		IsActiveFunc isac_func;
-
-		if (g_module_symbol (module, "hildon_thumbnail_outplugin_is_active", (gpointer *) &isac_func)) {
-			if (isac_func ()) {
-				outplugs = g_list_prepend (outplugs, module);
-				g_module_make_resident (module);
-			}
-		}
+		g_module_make_resident (module);
+		outplugs = g_list_prepend (outplugs, module);
 	}
 
 	g_free (path);
@@ -90,15 +84,21 @@
 
 		if (g_module_symbol (module, "hildon_thumbnail_outplugin_out", (gpointer *) &out_func)) {
 
-			out_func (rgb8_pixmap, width, height, rowstride, bits_per_sample, type, mtime, uri, &nerror);
+			IsActiveFunc isac_func;
 
-			if (nerror) {
-				if (!errors) {
-					errors = g_string_new ("");
-					domain = nerror->domain;
+			if (g_module_symbol (module, "hildon_thumbnail_outplugin_is_active", (gpointer *) &isac_func)) {
+				if (isac_func ()) {
+					out_func (rgb8_pixmap, width, height, rowstride, bits_per_sample, type, mtime, uri, &nerror);
+
+					if (nerror) {
+						if (!errors) {
+							errors = g_string_new ("");
+							domain = nerror->domain;
+						}
+						g_string_append (errors, nerror->message);
+						g_error_free (nerror);
+					}
 				}
-				g_string_append (errors, nerror->message);
-				g_error_free (nerror);
 			}
 
 		}

Modified: projects/haf/trunk/hildon-thumbnail/daemon/utils.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/daemon/utils.c	2008-11-13 13:59:46 UTC (rev 16660)
+++ projects/haf/trunk/hildon-thumbnail/daemon/utils.c	2008-11-13 14:08:20 UTC (rev 16661)
@@ -98,9 +98,11 @@
 	else
 		thumb_filename = g_strdup_printf ("%s.jpeg", ascii_digest);
 
-	cropped_filename = g_strdup_printf ("%s.jpeg", ascii_digest);
+	if (as_png)
+		cropped_filename = g_strdup_printf ("%s.png", ascii_digest);
+	else
+		cropped_filename = g_strdup_printf ("%s.jpeg", ascii_digest);
 
-
 	*large = g_build_filename (large_dir, thumb_filename, NULL);
 	*normal = g_build_filename (normal_dir, thumb_filename, NULL);
 	*cropped = g_build_filename (cropped_dir, cropped_filename, NULL);
@@ -115,8 +117,12 @@
 				lthumb_filename = g_strdup_printf ("%s.png", lascii_digest);
 			else
 				lthumb_filename = g_strdup_printf ("%s.jpeg", lascii_digest);
-			lcropped_filename = g_strdup_printf ("%s.jpeg", lascii_digest);
 
+			if (as_png)
+				lcropped_filename = g_strdup_printf ("%s.png", lascii_digest);
+			else
+				lcropped_filename = g_strdup_printf ("%s.jpeg", lascii_digest);
+
 			if (local_large)
 				*local_large = g_build_filename (local_dir, "large", lthumb_filename, NULL);
 			if (local_normal)


More information about the maemo-commits mailing list