Re: [PATCH] upnp: add support for thumbnails




On Fri, 21 Jan 2011 10:39:20 +0100, Guillaume Emont <gemont igalia com> wrote:
On 21/01/2011 08:53, Iago Toral wrote:

On Thu, 20 Jan 2011 17:26:54 +0100, Guillaume Emont
<gemont igalia com> wrote:
(...)
+static gboolean
+has_thumbnail_marker (xmlNode *node)
+{
+  gchar *dlna_stuff;
+  gboolean ret;
+
+  dlna_stuff = didl_res_get_protocol_info (node, 3);
+  ret = strstr("JPEG_TN", dlna_stuff) != NULL;
+
+  g_free (dlna_stuff);
+  return ret;
+}
+
(...)

if this is the only code required to support other image formats, then I see no reason to ignore PNG_* or JPEG_SM, even if they are not that
common, or am I missing something?
In get_thumbnail(), this function is only used to give priority to a
JPEG_TN over other <res> that don't provide such a marker, to get out of
the loop earlier. Right now, PNG_* and JPEG_SM are supported by the
"last <res/> with an image/* mimetype" rule, only, in case a JPEG_TN is there, it is given priority (or maybe we could remove that altogether, and only apply the last <res/> rule, which would make the code simpler).

Ah, I see. I was asking because you said this:

"In the end, I did not implement PNG_* nor JPEG_SM, as they seem relatively
uncommon to me. They can easily be added later on though."

Then I understand you only meant that you did not implement means to give them priority over the JPEG_TN version, which is the thing that could be added later on.

Iago


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]