[ease] [editor] Better handling of Flickr/OCA image sizes



commit a63bb8107f627395b84459be37c95a950e3bc657
Author: Nate Stedman <natesm gmail com>
Date:   Mon Aug 23 05:55:55 2010 -0400

    [editor] Better handling of Flickr/OCA image sizes
    
    - OpenClipArt uses a thumbnail PNG for thumbnails
      instead of slow to load SVG files
    - Flickr uses larger images for the thumbnails to
      remove blurriness and much larger images for
      actual import.

 data/ui/import-widget.ui                  |    3 +++
 ease-core/ease-plugin-import-service.vala |    1 -
 ease/ease-import-flickr-service.vala      |    5 ++---
 ease/ease-import-oca-service.vala         |    8 ++++++--
 4 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/import-widget.ui b/data/ui/import-widget.ui
index 07cb6cc..7d941a7 100644
--- a/data/ui/import-widget.ui
+++ b/data/ui/import-widget.ui
@@ -63,6 +63,9 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="selection_mode">multiple</property>
+                    <property name="row_spacing">0</property>
+                    <property name="column_spacing">0</property>
+                    <property name="margin">0</property>
                   </object>
                 </child>
               </object>
diff --git a/ease-core/ease-plugin-import-service.vala b/ease-core/ease-plugin-import-service.vala
index c8d82b0..29cf13b 100644
--- a/ease-core/ease-plugin-import-service.vala
+++ b/ease-core/ease-plugin-import-service.vala
@@ -173,7 +173,6 @@ public abstract class Ease.Plugin.ImportService : GLib.Object
 		var pixbuf = gdk_pixbuf_from_uri(image.thumb_link == null ?
 		                                 image.file_link : 
 		                                 image.thumb_link);
-		
 		// append to the model
 		var tree_itr = Gtk.TreeIter();
 		lock (model)
diff --git a/ease/ease-import-flickr-service.vala b/ease/ease-import-flickr-service.vala
index 1f13aab..e485ee8 100644
--- a/ease/ease-import-flickr-service.vala
+++ b/ease/ease-import-flickr-service.vala
@@ -60,7 +60,6 @@ public class Ease.FlickrService : Plugin.ImportService {
 			error ("Couldn't parse JSON data: %s", e.message);
 		}
 
-		//print ("==START PAYLOAD==\n%s\n==END PAYLOAD==", jsondata);
 		Json.Object obj = parser.get_root().get_object ();
 
 		var stat = obj.get_string_member ("stat");
@@ -98,8 +97,8 @@ public class Ease.FlickrService : Plugin.ImportService {
 		string flickr = ".static.flickr.com/";
 		
 		var image = new FlickrMedia();
-		image.file_link = http + farm + flickr + server + "/" + id + "_" + secret + "_t.jpg";
-		image.thumb_link = image.file_link;
+		image.file_link = http + farm + flickr + server + "/" + id + "_" + secret + "_b.jpg";
+		image.thumb_link = http + farm + flickr + server + "/" + id + "_" + secret + "_m.jpg";
 		// TODO : unittest to track Flickr API changes.
 		// TODO : license
 		image.title = photo.get_string_member ("title");
diff --git a/ease/ease-import-oca-service.vala b/ease/ease-import-oca-service.vala
index d47c40a..b7707f0 100644
--- a/ease/ease-import-oca-service.vala
+++ b/ease/ease-import-oca-service.vala
@@ -61,6 +61,8 @@ internal class Ease.OCAService : Plugin.ImportService
 				for (Xml.Node* tag = itr->children;
 				     tag != null; tag = tag->next)
 				{
+					debug(tag->name);
+					
 					switch (tag->name)
 					{
 						case "title":
@@ -88,13 +90,15 @@ internal class Ease.OCAService : Plugin.ImportService
 								}
 							}
 							break;
-						case "media:thumbnail":
+						case "thumbnail":
 							for (Xml.Attr* prop = tag->properties;
 							     prop != null; prop = prop->next)
 							{
 								if (prop->name == "url")
 								{
-									image.thumb_link = prop->children->content;
+									var thumb = prop->children->content;
+									image.thumb_link = thumb.replace("90px",
+									                                 "125px");
 								}
 							}
 							break;



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