[gthumb/ext] check mime type before calling a metadata provider
- From: Paolo Bacchilega <paobac src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gthumb/ext] check mime type before calling a metadata provider
- Date: Tue, 18 Aug 2009 19:11:15 +0000 (UTC)
commit 822ab664f7e7d749c8a464f23f1bc003b67103a2
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Aug 18 18:18:37 2009 +0200
check mime type before calling a metadata provider
extensions/exiv2/gth-metadata-provider-exiv2.c | 3 +++
.../image_viewer/gth-metadata-provider-image.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/extensions/exiv2/gth-metadata-provider-exiv2.c b/extensions/exiv2/gth-metadata-provider-exiv2.c
index 35ae8b3..f0b946d 100644
--- a/extensions/exiv2/gth-metadata-provider-exiv2.c
+++ b/extensions/exiv2/gth-metadata-provider-exiv2.c
@@ -50,6 +50,9 @@ gth_metadata_provider_exiv2_read (GthMetadataProvider *self,
char *sidecar_uri;
GthFileData *sidecar_file_data;
+ if (! g_content_type_equals (gth_file_data_get_mime_type (file_data), "image/jpeg"))
+ return;
+
/* this function is executed in a secondary thread, so calling
* slow sync functions is not a problem. */
diff --git a/extensions/image_viewer/gth-metadata-provider-image.c b/extensions/image_viewer/gth-metadata-provider-image.c
index 53eef88..fc6a32a 100644
--- a/extensions/image_viewer/gth-metadata-provider-image.c
+++ b/extensions/image_viewer/gth-metadata-provider-image.c
@@ -49,6 +49,9 @@ gth_metadata_provider_image_read (GthMetadataProvider *self,
char *filename;
int width, height;
+ if (! g_content_type_is_a (gth_file_data_get_mime_type (file_data), "image"))
+ return;
+
filename = g_file_get_path (file_data->file);
format = gdk_pixbuf_get_file_info (filename, &width, &height);
if (format != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]