From fc5d0617564c77ed7e48c9a40b05930bb05aff59 Mon Sep 17 00:00:00 2001 From: Raul Gutierrez Segales Date: Wed, 26 Oct 2011 16:16:23 +0100 Subject: [PATCH] e-d-s: set content type on ContactPhotos Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=662616 --- NEWS | 1 + backends/eds/lib/edsf-persona-store.vala | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 198891e..6113612 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ Bugs fixed: parameters. * Bug 660908 — Add favourites support to EDS backend * Bug 662770 — ContactPhotos are ignored when mime type is null +* Bug 662616 — We should set mime type when setting an EContact's photo API changes: * Add AbstractFieldDetails.id to identify instances of details diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala index 93f60ee..ea75f17 100644 --- a/backends/eds/lib/edsf-persona-store.vala +++ b/backends/eds/lib/edsf-persona-store.vala @@ -1295,6 +1295,15 @@ public class Edsf.PersonaStore : Folks.PersonaStore } cp.set_inlined (image_data); + + bool uncertain = false; + var mime_type = ContentType.guess (null, image_data, + out uncertain); + if (mime_type != null && !uncertain) + { + cp.set_mime_type (mime_type); + } + contact.set (ContactField.PHOTO, cp); } catch (GLib.Error e1) -- 2.7.4