Package: libflickrnet2.1.5-cil
Version: 25277-6
Severity: important
Tags: patch

This was reported at
https://bugs.launchpad.net/ubuntu/+source/libflickrnet/+bug/288070 :

"f-spot crashes when trying to authorize access to Zooomr in order to
export pictures.

How to reproduce crash:

1.- Open f-spot and import some pictures if necessary.
2.- Select at least one picture.
3.- Go to menu: Photo->Export to->Zooomr
4.- f-spot will ask you to Authorize it, in order to upload photos.
Click the button labeled "Authorize" in the "Export" Dialog and f-spot
will crash.

What should have happened:

After clicking "Authorize" f-spot should have opened a new browser
window or tab sending you to Zooomr API authorization page, as it
happens with Flickr export. After that you would be able to click
"Complete Authorization" and export the desired pictures to Zooomr (as
it happens with Flickr export)

The output from f-spot --debug is the following:

$ f-spot --debug
** Running f-spot in Debug Mode **
** Running Mono with --debug **
[Info 12:51:46.468] Initializing DBus
[Debug 12:51:46.647] DBusInitialization took 0.138103s
[Info 12:51:46.647] Initializing Mono.Addins
[Debug 12:51:46.890] Mono.Addins Initialization took 0.242322s
[Info 12:51:46.897] Starting new FSpot server
[Debug 12:51:47.064] Db Initialization took 0.077519s
[Debug 12:51:47.490] QueryToTemp took 0.005044s : SELECT id, time, uri,
description, roll_id, default_version_id, rating, md5_sum FROM photos
WHERE id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER
BY time DESC
[Debug 12:51:47.648] Query took 0.015846s : SELECT * FROM
photoquery_temp_0 LIMIT 100 OFFSET 0
[Debug 12:51:47.737] PhotosPerMonth took 0.017206s
[Debug 12:51:47.738] TimeAdaptor REAL Reload took 0.225277s
[Info 12:51:47.764] Starting BeagleService
[Debug 12:51:47.765] BeagleService startup took 1.5E-05s
[Info 12:51:47.765] Hack for gnome-settings-daemon engaged
[Debug 12:51:47.862] IndexOf took 0.000718s : SELECT ROWID FROM
photoquery_temp_0 WHERE time <= 1230764399 ORDER BY time DESC LIMIT 1
[Debug 12:51:47.863] IndexOf took 0.000515s : SELECT ROWID FROM
photoquery_temp_0 WHERE id = 262

(f-spot:12550): GdkPixbuf-WARNING **: GdkPixbufLoader finalized without
calling gdk_pixbuf_loader_close() - this is not allowed. You must
explicitly end the data stream to the loader before dropping the last
reference.
[Debug 12:51:51.461] open uri =
file:///home/lnieves/Photos/2008/10/22/img_0275.jpg
[Debug 12:51:51.583] open uri =
file:///home/lnieves/Photos/2008/10/22/img_0275.jpg
[Debug 12:51:51.584] open uri =
file:///home/lnieves/Photos/2008/10/22/img_0275.jpg

(f-spot:12550): Gtk-WARNING **: GtkSpinButton: setting an adjustment
with non-zero page size is deprecated

(f-spot:12550): Gtk-WARNING **: GtkSpinButton: setting an adjustment
with non-zero page size is deprecated
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to
handle the exception.
System.Net.ProtocolViolationException: Cannot send data when method is:
GET
  at System.Net.HttpWebRequest.BeginGetRequestStream
(System.AsyncCallback callback, System.Object state) [0x00000]
  at System.Net.HttpWebRequest.GetRequestStream () [0x00000]
  at FlickrNet.Flickr.DoGetResponse (System.String url, System.String
variables) [0x00000]
  at FlickrNet.Flickr.GetResponse (System.Collections.Hashtable
parameters, TimeSpan cacheTimeout) [0x00000]
  at FlickrNet.Flickr.GetResponseNoCache (System.Collections.Hashtable
parameters) [0x00000]
  at FlickrNet.Flickr.AuthGetFrob () [0x00000]
  at FlickrRemote.TryWebLogin () [0x00000]
  at FSpotFlickrExport.FlickrExport.Login () [0x00000]
  at FSpotFlickrExport.FlickrExport.HandleClicked (System.Object sender,
System.EventArgs args) [0x00000]
  at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr data)
[0x00000]
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e,
Boolean is_terminal)
   at GLib.Signal.voidObjectCallback(IntPtr handle, IntPtr data)
   at GLib.Signal.voidObjectCallback(IntPtr , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Gnome.Program.Run()
   at FSpot.Driver.Main(System.String[] args)
[Debug 12:53:45.643] Finalizer called on FSpot.Category. Should be
Disposed
[Debug 12:53:45.644] Finalizer called on FSpot.Category. Should be
Disposed
[Debug 12:53:45.645] Finalizer called on FSpot.Category. Should be
Disposed
[Debug 12:53:45.646] Finalizer called on
FSpot.Utils.DisposableCache`2[System.String,Gdk.Pixbuf]. Should be
Disposed
[Debug 12:53:45.652] Finalizer called on FSpot.Category. Should be
Disposed
[Debug 12:53:45.652] Finalizer called on FSpot.Category. Should be
Disposed
[Debug 12:53:45.653] Finalizer called on FSpot.Category. Should be
Disposed
[Debug 12:53:45.653] Finalizer called on FSpot.Category. Should be
Disposed
[Debug 12:53:45.655] Finalizer called on FSpot.Tag. Should be Disposed"

The version of libflickrnet bundled with F-Spot doesn't exhibit this
crash. I'm attaching a patch which fixes this (and is included in the
bundled F-spot version of this library). The patch was also sent to the
libflickrnet issue tracker, but it seems fairly quiet there
(http://www.codeplex.com/FlickrNet/WorkItem/View.aspx?WorkItemId=2459)
Index: libflickrnet-25277/FlickrNet/Flickr.cs
===================================================================
--- libflickrnet-25277.orig/FlickrNet/Flickr.cs	2008-10-24 19:38:04.000000000 +0100
+++ libflickrnet-25277/FlickrNet/Flickr.cs	2008-10-24 19:38:33.000000000 +0100
@@ -54,7 +54,7 @@
 
 		private string[] _baseUrl = new string[] { 
 															"http://api.flickr.com/services/rest/";, 
-															"http://beta.zooomr.com/bluenote/api/rest";,
+															"http://www.zooomr.com/api/rest/";,
 															"http://www.23hq.com/services/rest/"};
 
 		private string UploadUrl
@@ -63,7 +63,7 @@
 		}
 		private static string[] _uploadUrl = new string[] {
 															  "http://api.flickr.com/services/upload/";,
-															  "http://beta.zooomr.com/bluenote/api/upload";,
+															  "http://www.zooomr.com/api/upload";,
 															  "http://www.23hq.com/services/upload/"};
 
 		private string ReplaceUrl
@@ -72,7 +72,7 @@
 		}
 		private static string[] _replaceUrl = new string[] {
 															   "http://api.flickr.com/services/replace/";,
-															   "http://beta.zooomr.com/bluenote/api/replace";,
+															   "http://www.zooomr.com/api/replace";,
 															   "http://www.23hq.com/services/replace/"};
 
 		private string AuthUrl
@@ -81,7 +81,7 @@
 		}
 		private static string[] _authUrl = new string[] {
 															   "http://www.flickr.com/services/auth/";,
-															   "http://beta.zooomr.com/auth/";,
+															   "http://www.zooomr.com/services/auth/";,
 															   "http://www.23hq.com/services/auth/"};
 
 		private string _apiKey;
@@ -443,7 +443,8 @@
             {
                 // This is needed in the Compact Framework
                 // See for more details: http://msdn2.microsoft.com/en-us/library/1afx2b0f.aspx
-                req.GetRequestStream().Close();
+              	if (req.Method=="POST")
+	                req.GetRequestStream().Close();
             }
 
 			try
@@ -718,7 +719,7 @@
 			FlickrNet.Response response = GetResponseNoCache(parameters);
 			if( response.Status == ResponseStatus.OK )
 			{
-				return response.AllElements[0].InnerText;
+				return response.AllElements[CurrentService==SupportedService.Zooomr?1:0].InnerText;
 			}
 			else
 			{
@@ -789,7 +790,7 @@
 			FlickrNet.Response response = GetResponseNoCache(parameters);
 			if( response.Status == ResponseStatus.OK )
 			{
-				Auth auth = new Auth(response.AllElements[0]);
+				Auth auth = new Auth(response.AllElements[CurrentService==SupportedService.Zooomr?1:0]);
 				return auth;
 			}
 			else
@@ -837,7 +838,7 @@
 			FlickrNet.Response response = GetResponseNoCache(parameters);
 			if( response.Status == ResponseStatus.OK )
 			{
-				Auth auth = new Auth(response.AllElements[0]);
+				Auth auth = new Auth(response.AllElements[CurrentService==SupportedService.Zooomr?1:0]);
 				return auth;
 			}
 			else

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to