[maemo-commits] [maemo-commits] r18325 - in projects/haf/trunk/hildon-thumbnail: . daemon daemon/plugins
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue May 12 12:24:55 EEST 2009
- Previous message: [maemo-commits] r18324 - projects/haf/trunk/dbus/debian/patches
- Next message: [maemo-commits] r18326 - in projects/haf/trunk/hildon-thumbnail: . thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: pvanhoof Date: 2009-05-12 12:24:46 +0300 (Tue, 12 May 2009) New Revision: 18325 Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.h projects/haf/trunk/hildon-thumbnail/daemon/plugins/epeg-plugin.c projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-plugin.c projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-png-out-plugin.c projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c Log: 2009-05-12 Philip Van Hoof <pvanhoof at codeminded.be> * daemon/hildon-thumbnail-plugin.h: * daemon/plugins/gdkpixbuf-plugin.c: * daemon/plugins/gdkpixbuf-png-out-plugin.c: * daemon/plugins/gdkpixbuf-jpeg-out-plugin.c: * daemon/plugins/gstreamer-video-plugin.c: * daemon/plugins/epeg-plugin.c: * daemon/hildon-thumbnail-plugin.c: Bugfix for bug# 116002. Throw an error instead of Ready in case the fail-file is seen Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog =================================================================== --- projects/haf/trunk/hildon-thumbnail/ChangeLog 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/ChangeLog 2009-05-12 09:24:46 UTC (rev 18325) @@ -1,3 +1,14 @@ +2009-05-12 Philip Van Hoof <pvanhoof at codeminded.be> + + * daemon/hildon-thumbnail-plugin.h: + * daemon/plugins/gdkpixbuf-plugin.c: + * daemon/plugins/gdkpixbuf-png-out-plugin.c: + * daemon/plugins/gdkpixbuf-jpeg-out-plugin.c: + * daemon/plugins/gstreamer-video-plugin.c: + * daemon/plugins/epeg-plugin.c: + * daemon/hildon-thumbnail-plugin.c: Bugfix for bug# 116002. Throw an + error instead of Ready in case the fail-file is seen + 2009-05-11 Marius Vollmer <marius.vollmer at nokia.com> * daemon/Makefile.am (install-data-local): Create Modified: projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.c 2009-05-12 09:24:46 UTC (rev 18325) @@ -174,12 +174,12 @@ typedef gboolean (*NeedsOutFunc) (HildonThumbnailPluginOutType type, - guint64 mtime, const gchar *uri); + guint64 mtime, const gchar *uri, gboolean *err_file); gboolean hildon_thumbnail_outplugins_needs_out (HildonThumbnailPluginOutType type, - guint64 mtime, const gchar *uri) + guint64 mtime, const gchar *uri, gboolean *err_file) { GList *copy; gboolean retval = FALSE; @@ -195,7 +195,7 @@ IsActiveFunc isac_func; if (g_module_symbol (module, "hildon_thumbnail_outplugin_is_active", (gpointer *) &isac_func)) { if (isac_func ()) { - retval = needs_out_func (type, mtime, uri); + retval = needs_out_func (type, mtime, uri, err_file); } } } Modified: projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.h =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.h 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/daemon/hildon-thumbnail-plugin.h 2009-05-12 09:24:46 UTC (rev 18325) @@ -72,7 +72,7 @@ GError **error); gboolean hildon_thumbnail_outplugins_needs_out (HildonThumbnailPluginOutType type, guint64 mtime, - const gchar *uri); + const gchar *uri, gboolean *err_file); gchar * hildon_thumbnail_outplugins_get_orig (const gchar *path); void hildon_thumbnail_outplugins_cleanup (const gchar *uri_match, Modified: projects/haf/trunk/hildon-thumbnail/daemon/plugins/epeg-plugin.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/plugins/epeg-plugin.c 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/daemon/plugins/epeg-plugin.c 2009-05-12 09:24:46 UTC (rev 18325) @@ -163,6 +163,7 @@ const guchar *rgb8_pixels; guint width; guint height; guint rowstride; + gboolean err_file = FALSE; file = g_file_new_for_uri (uri); path = g_file_get_path (file); @@ -181,9 +182,9 @@ mtime = g_file_info_get_attribute_uint64 (finfo, G_FILE_ATTRIBUTE_TIME_MODIFIED); - if (!hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri) && - !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri) && - !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri)) + if (!hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri, &err_file) && + !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri, &err_file) && + !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri, &err_file)) goto nerror_handler; im = epeg_file_open (path); @@ -238,7 +239,7 @@ } - if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri)) { + if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri, &err_file)) { rgb8_pixels = gdk_pixbuf_get_pixels (pixbuf_large); width = gdk_pixbuf_get_width (pixbuf_large); @@ -260,7 +261,7 @@ } - if (do_cropped && hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri)) { + if (do_cropped && hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri, &err_file)) { pixbuf_cropped = crop_resize (pixbuf_large, 124, 124); @@ -286,7 +287,7 @@ } - if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri)) { + if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri, &err_file)) { pixbuf_normal = gdk_pixbuf_scale_simple (pixbuf_large, 128, 128, @@ -316,13 +317,15 @@ nerror_handler: - if (had_err || nerror) { + if (had_err || nerror || err_file) { gchar *msg; if (nerror) { msg = g_strdup (nerror->message); g_error_free (nerror); nerror = NULL; - } else + } else if (err_file) + msg = g_strdup ("Failed before"); + else msg = g_strdup_printf ("Can't open %s", uri); if (!errors) errors = g_string_new (""); Modified: projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-jpeg-out-plugin.c 2009-05-12 09:24:46 UTC (rev 18325) @@ -165,7 +165,7 @@ } gboolean -hildon_thumbnail_outplugin_needs_out (HildonThumbnailPluginOutType type, guint64 mtime, const gchar *uri) +hildon_thumbnail_outplugin_needs_out (HildonThumbnailPluginOutType type, guint64 mtime, const gchar *uri, gboolean *err_file) { gboolean retval, check = FALSE; gchar *large, *normal, *cropped, *filen, *filenp; @@ -223,6 +223,8 @@ fmtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED); if (fmtime == (guint64) mtime) { + if (err_file) + *err_file = TRUE; retval = FALSE; } g_object_unref (info); @@ -272,6 +274,8 @@ g_object_unref (fail_dir); g_free (filenp); + if (g_file_query_exists (fail_file, NULL)) + g_file_delete (fail_file, NULL, NULL); out = g_file_create (fail_file, 0, NULL, &error); if (out) { Modified: projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-plugin.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-plugin.c 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-plugin.c 2009-05-12 09:24:46 UTC (rev 18325) @@ -179,6 +179,7 @@ const guchar *rgb8_pixels; guint width; guint height; guint rowstride; + gboolean err_file = FALSE; file = g_file_new_for_uri (uri); @@ -191,9 +192,9 @@ mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED); - if (!hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri) && - !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri) && - !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri)) + if (!hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri, &err_file) && + !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri, &err_file) && + !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri, &err_file)) goto nerror_handler; stream = g_file_read (file, NULL, &nerror); @@ -201,7 +202,7 @@ if (nerror) goto nerror_handler; - if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri)) { + if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uri, &err_file)) { GdkPixbuf *pixbuf_large1 = gdk_pixbuf_new_from_stream_at_scale (G_INPUT_STREAM (stream), 256, 256, @@ -247,7 +248,7 @@ } - if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri)) { + if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uri, &err_file)) { GdkPixbuf *pixbuf_normal1 = gdk_pixbuf_new_from_stream_at_scale (G_INPUT_STREAM (stream), 128, 128, @@ -292,7 +293,7 @@ } - if (do_cropped && hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri)) { + if (do_cropped && hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uri, &err_file)) { GdkPixbuf *pixbuf1 = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (stream), NULL, @@ -339,13 +340,14 @@ if (stream) g_input_stream_close (G_INPUT_STREAM (stream), NULL, NULL); - if (nerror) { + if (nerror || err_file) { if (!errors) errors = g_string_new (""); g_string_append_printf (errors, "[`%s': %s] ", - uri, nerror->message); + uri, nerror ? nerror->message:"Had error before"); failed = g_list_prepend (failed, g_strdup (uri)); - g_error_free (nerror); + if (nerror) + g_error_free (nerror); nerror = NULL; } Modified: projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-png-out-plugin.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-png-out-plugin.c 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/daemon/plugins/gdkpixbuf-png-out-plugin.c 2009-05-12 09:24:46 UTC (rev 18325) @@ -187,7 +187,7 @@ } gboolean -hildon_thumbnail_outplugin_needs_out (HildonThumbnailPluginOutType type, guint64 mtime, const gchar *uri) +hildon_thumbnail_outplugin_needs_out (HildonThumbnailPluginOutType type, guint64 mtime, const gchar *uri, gboolean *err_file) { gboolean retval, check = FALSE; gchar *large, *normal, *cropped, *filen, *filenp; @@ -245,6 +245,8 @@ fmtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED); if (fmtime == (guint64) mtime) { + if (err_file) + *err_file = TRUE; retval = FALSE; } g_object_unref (info); @@ -295,6 +297,8 @@ g_object_unref (fail_dir); g_free (filenp); + if (g_file_query_exists (fail_file, NULL)) + g_file_delete (fail_file, NULL, NULL); out = g_file_create (fail_file, 0, NULL, &error); if (out) { Modified: projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c 2009-05-12 09:13:43 UTC (rev 18324) +++ projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c 2009-05-12 09:24:46 UTC (rev 18325) @@ -93,8 +93,10 @@ static void create_output (HildonThumbnailPluginOutType target, unsigned char *data, guint width, guint height, guint bpp, const gchar *uri, guint mtime, gboolean alpha, GError **error) { - if (hildon_thumbnail_outplugins_needs_out (target, mtime, uri)) { + gboolean err_file; + if (hildon_thumbnail_outplugins_needs_out (target, mtime, uri, &err_file)) { + hildon_thumbnail_outplugins_do_out (data, width, height, width*3, bpp/3, alpha, target, mtime, uri, @@ -517,6 +519,7 @@ GFile *file = NULL; GFileInfo *finfo = NULL; guint64 mtime; + gboolean err_file = FALSE; file = g_file_new_for_uri (uris[i]); @@ -529,9 +532,9 @@ mtime = g_file_info_get_attribute_uint64 (finfo, G_FILE_ATTRIBUTE_TIME_MODIFIED); - if (!hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uris[i]) && - !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uris[i]) && - !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uris[i])) + if (!hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uris[i], &err_file) && + !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uris[i], &err_file) && + !hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uris[i], &err_file)) goto nerror_handler; /* Create the thumbnailer struct */ @@ -546,7 +549,7 @@ thumber->uri = uris[i]; - if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uris[i])) { + if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL, mtime, uris[i], &err_file)) { thumber->target = HILDON_THUMBNAIL_PLUGIN_OUTTYPE_NORMAL; thumber->size = 128; @@ -556,7 +559,7 @@ goto nerror_handler; } - if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uris[i])) { + if (hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE, mtime, uris[i], &err_file)) { thumber->target = HILDON_THUMBNAIL_PLUGIN_OUTTYPE_LARGE; thumber->size = 256; @@ -567,7 +570,7 @@ goto nerror_handler; } - if (do_cropped && hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uris[i])) { + if (do_cropped && hildon_thumbnail_outplugins_needs_out (HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED, mtime, uris[i], &err_file)) { thumber->target = HILDON_THUMBNAIL_PLUGIN_OUTTYPE_CROPPED; thumber->size = 124; @@ -602,13 +605,14 @@ if (file) g_object_unref (file); - if (nerror) { + if (nerror || err_file) { if (!errors) errors = g_string_new (""); g_string_append_printf (errors, "[`%s': %s] ", - uris[i], nerror->message); - g_error_free (nerror); - failed = g_list_prepend (failed, g_strdup (uris[i])); + thumber->uri, nerror ? nerror->message:"Had error before"); + failed = g_list_prepend (failed, g_strdup (thumber->uri)); + if (nerror) + g_error_free (nerror); nerror = NULL; }
- Previous message: [maemo-commits] r18324 - projects/haf/trunk/dbus/debian/patches
- Next message: [maemo-commits] r18326 - in projects/haf/trunk/hildon-thumbnail: . thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]