[rygel] core,data: Provide icons in JPEG format as well



commit 729c5b45d8d2ac1ca6769556d5fce189f5a95923
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Aug 5 17:03:55 2010 +0300

    core,data: Provide icons in JPEG format as well
    
    Provide icons confirming to JPEG_SM_ICO and JPEG_LRG_ICO DLNA profiles.
    This change together with commit ea506c4 enables rygel to pass DLNA CTT
    testcase 7.2.28.1,2,3 with a warning.

 data/icons/120x120/Makefile.am |    2 +-
 data/icons/48x48/Makefile.am   |    2 +-
 src/rygel/rygel-plugin.vala    |   49 ++++++++++++++++++++++++++++++---------
 3 files changed, 39 insertions(+), 14 deletions(-)
---
diff --git a/data/icons/120x120/Makefile.am b/data/icons/120x120/Makefile.am
index 3f6ff94..3771fee 100644
--- a/data/icons/120x120/Makefile.am
+++ b/data/icons/120x120/Makefile.am
@@ -1,4 +1,4 @@
 icondir = $(datadir)/icons/hicolor/120x120/apps
-icon_DATA = rygel.png
+icon_DATA = rygel.png rygel.jpg
 
 EXTRA_DIST = $(icon_DATA)
diff --git a/data/icons/48x48/Makefile.am b/data/icons/48x48/Makefile.am
index e327d34..a9016c3 100644
--- a/data/icons/48x48/Makefile.am
+++ b/data/icons/48x48/Makefile.am
@@ -1,4 +1,4 @@
 icondir = $(datadir)/icons/hicolor/48x48/apps
-icon_DATA = rygel.png
+icon_DATA = rygel.png rygel.jpg
 
 EXTRA_DIST = $(icon_DATA)
diff --git a/src/rygel/rygel-plugin.vala b/src/rygel/rygel-plugin.vala
index 1f2c986..ae77b45 100644
--- a/src/rygel/rygel-plugin.vala
+++ b/src/rygel/rygel-plugin.vala
@@ -30,17 +30,26 @@ using GUPnP;
  */
 public class Rygel.Plugin : GUPnP.ResourceFactory {
     private static const string PNG_EXT = "png";
+    private static const string JPG_EXT = "jpg";
 
     private static const string ICON_BIG = "file://" +
                                            BuildConfig.BIG_ICON_DIR +
-                                           "/rygel." +
-                                           PNG_EXT;
+                                           "/rygel";
+    private static const string ICON_PNG_BIG = ICON_BIG + "." + PNG_EXT;
+    private static const string ICON_JPG_BIG = ICON_BIG + "." + JPG_EXT;
+
     private static const string ICON_SMALL = "file://" +
                                              BuildConfig.SMALL_ICON_DIR +
-                                             "/rygel." +
-                                             PNG_EXT;
-    private static const string ICON_MIME = "image/png";
-    private static const int ICON_DEPTH = 32;
+                                             "/rygel";
+    private static const string ICON_PNG_SMALL = ICON_SMALL + "." + PNG_EXT;
+    private static const string ICON_JPG_SMALL = ICON_SMALL + "." + JPG_EXT;
+
+    private static const string ICON_PNG_MIME = "image/png";
+    private static const string ICON_JPG_MIME = "image/jpeg";
+
+    private static const int ICON_PNG_DEPTH = 32;
+    private static const int ICON_JPG_DEPTH = 24;
+
     private static const int ICON_BIG_WIDTH = 120;
     private static const int ICON_BIG_HEIGHT = 120;
     private static const int ICON_SMALL_WIDTH = 48;
@@ -79,18 +88,34 @@ public class Rygel.Plugin : GUPnP.ResourceFactory {
         this.icon_infos = new ArrayList<IconInfo> ();
         this.default_icons = new ArrayList<IconInfo> ();
 
-        var icon = new IconInfo (ICON_MIME, PNG_EXT);
-        icon.uri = ICON_BIG;
+        // Add PNG icons
+        var icon = new IconInfo (ICON_PNG_MIME, PNG_EXT);
+        icon.uri = ICON_PNG_BIG;
+        icon.width = ICON_BIG_WIDTH;
+        icon.height = ICON_BIG_HEIGHT;
+        icon.depth = ICON_PNG_DEPTH;
+        this.default_icons.add (icon);
+
+        icon = new IconInfo (ICON_PNG_MIME, PNG_EXT);
+        icon.uri = ICON_PNG_SMALL;
+        icon.width = ICON_SMALL_WIDTH;
+        icon.height = ICON_SMALL_HEIGHT;
+        icon.depth = ICON_PNG_DEPTH;
+        this.default_icons.add (icon);
+
+        // Then add JPEG icons
+        icon = new IconInfo (ICON_JPG_MIME, JPG_EXT);
+        icon.uri = ICON_JPG_BIG;
         icon.width = ICON_BIG_WIDTH;
         icon.height = ICON_BIG_HEIGHT;
-        icon.depth = ICON_DEPTH;
+        icon.depth = ICON_JPG_DEPTH;
         this.default_icons.add (icon);
 
-        icon = new IconInfo (ICON_MIME, PNG_EXT);
-        icon.uri = ICON_SMALL;
+        icon = new IconInfo (ICON_JPG_MIME, JPG_EXT);
+        icon.uri = ICON_JPG_SMALL;
         icon.width = ICON_SMALL_WIDTH;
         icon.height = ICON_SMALL_HEIGHT;
-        icon.depth = ICON_DEPTH;
+        icon.depth = ICON_JPG_DEPTH;
         this.default_icons.add (icon);
     }
 



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