After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 344851 - export pictures to picasaweb.google.com
export pictures to picasaweb.google.com
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
0.1.x
Other All
: Normal enhancement
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-14 07:16 UTC by Robert Šmol
Modified: 2006-09-04 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Export to picasaweb (93.01 KB, patch)
2006-07-28 11:48 UTC, Stephane Delcroix
none Details | Review
Crash log (7.59 KB, text/plain)
2006-07-28 17:46 UTC, Lluís Pàmies
  Details
updated version (94.07 KB, patch)
2006-08-02 10:07 UTC, Stephane Delcroix
none Details | Review
with credentials sotred in gnome-keyring (91.24 KB, patch)
2006-08-09 09:15 UTC, Stephane Delcroix
none Details | Review
with credentials sotred in gnome-keyring (91.24 KB, patch)
2006-08-09 09:15 UTC, Stephane Delcroix
none Details | Review
Tar containing google-sharp & gnome-keyring-sharp (56.41 KB, application/x-compressed-tar)
2006-08-19 16:05 UTC, Thomas Van Machelen
  Details
the same in an unified patch (220.16 KB, patch)
2006-08-22 08:33 UTC, Stephane Delcroix
none Details | Review
updated version (again) (221.14 KB, patch)
2006-08-22 09:33 UTC, Stephane Delcroix
none Details | Review
last one for today (223.86 KB, patch)
2006-08-22 19:48 UTC, Stephane Delcroix
none Details | Review
updated version (224.09 KB, patch)
2006-08-23 13:40 UTC, Stephane Delcroix
none Details | Review
The one where percentage means something (224.10 KB, patch)
2006-08-25 09:46 UTC, Stephane Delcroix
none Details | Review
The one with the progressbar (233.14 KB, patch)
2006-08-25 16:03 UTC, Stephane Delcroix
none Details | Review
The one where the size is approx. (209.65 KB, patch)
2006-08-29 15:27 UTC, Stephane Delcroix
committed Details | Review

Description Robert Šmol 2006-06-14 07:16:56 UTC
Hi, google has just released Picasa webalbums recently. It would be great if f-spot supported export to Google Picasa just like for Flickr!.
Comment 1 Stephane Delcroix 2006-06-26 14:21:09 UTC
Do you have any invitations for picassaweb ?
Comment 2 Robert Šmol 2006-06-26 16:18:48 UTC
Hi, it seems it is now closed even for users with google account. I've raised a request at picasaweb help center and pointed them to this URL. Pending any feedback.
Comment 3 Larry Ewing 2006-06-28 13:26:51 UTC
Stepahane, I have an account and I'll be looking into it soon.
Comment 4 Stephane Delcroix 2006-06-28 13:44:51 UTC
Larry, nice!

it it possible to send invitations yet ?

about the implementation, what about writing it as a plugin... :)
Comment 5 Thomas Van Machelen 2006-07-28 06:58:04 UTC
As Miguel de Icaza posted in his blog:

<quote>
And he [Gonzalo] also just uploaded Google Sharp to subversion (module google-sharp). With GoogleSharp you can authenticate your application with Google and access some of their services. The one that both Gonzalo and myself care about is PicasaWeb. The code has everything for F-Spot to start exporting my pics there. 
</quote>

You can find the code here:
http://svn.myrealbox.com/viewcvs/trunk/google-sharp/


This will make the implementation a _lot_ easier.
Comment 6 Stephane Delcroix 2006-07-28 11:48:21 UTC
Created attachment 69816 [details] [review]
Export to picasaweb

This patch will allow export to picasaweb.

It's feature complete (as in PicasaWeb features), that means that it support multiple google accounts, creation of albums (private or public ones) and upload pictures to them.

It require google-sharp !
Comment 7 Lluís Pàmies 2006-07-28 17:46:10 UTC
Created attachment 69842 [details]
Crash log
Comment 8 Lluís Pàmies 2006-07-28 17:46:43 UTC
(In reply to comment #6)
> Created an attachment (id=69816) [edit]
> Export to picasaweb
> 
> This patch will allow export to picasaweb.
> 
> It's feature complete (as in PicasaWeb features), that means that it support
> multiple google accounts, creation of albums (private or public ones) and
> upload pictures to them.
> 
> It require google-sharp !
> 

This code crash for me ! 
I'm using the HEAD CVS version with your patch.

Steps to reproduce the error:
  1. Open f-spot
  2. Select an image
  3. File->Export->Picassa
  and crashes !!

I attach the output.
Thanks for all !
Comment 9 Stephane Delcroix 2006-07-28 18:04:17 UTC
Lluis, it's not a crash of the patch.
The first lines of the report log indicate that f-spot can't find the Mono.Google assembly.
I solved that in my install by cp  Mono.Google.dll to the same directory as f-spot.exe (in your case: /home/llpamies/applic/f-spot-bin/lib/f-spot/)
Comment 10 Gonzalo Paniagua Javier 2006-07-28 21:43:24 UTC
Hi Stephane.

I just tried your patch and it works perfectly.

To address the issue that Lluís had, I suggest having a copy of Mono.Google.dll inside f-spot module and install it in ${prefix}/lib/f-spot/, at least until Mono.Google.dll makes its way into the GAC.

The only thing I don't like is storing the username and password in a plain text file. What about using gnome-keyring for that?

Keep up the good work!
Comment 11 Stephane Delcroix 2006-07-29 09:00:23 UTC
Gonzalo (comment #10),

thx for the report.

I store the credentials in a file mainly for 2 reasons:
*) that's how is done in the GalleryExport code (and the GoogleExport code is a modified version of GalleryExport)
*) there's no (AFAIK) gnome-keyring support included in Mono. I can probably do it with gnome-keyring-sharp (http://russell.rucus.net/2005/gnome-keyring-sharp/), but it will add another dependency for compilation...
Comment 12 aurelien 2006-07-31 18:22:40 UTC
Hi,

I have just tested this, it works pretty fine except two points:

* it crashes when creating an album in french locale (I think it is Mono.Google the culprit here, it does not handle non-english date format)

* picasaweb does not handle the orientation EXIF tag (at least I think so), images should be really rotated before upload (AFAIR, I have seen a similar bug on the gallery export, but I do not have a gallery to test right now)

nice (and fast) work anyway!

PS: on the above crash: I also had a problem with the assembly not found, but for me it crashed at startup.
Comment 13 Gonzalo Paniagua Javier 2006-07-31 18:46:46 UTC
* Can I get a stack trace of the crash when using french locale? And also the DateTime string, please.

* When uploading a picture to picasa, there's a parameter that tells the orientation. I have never set it to anything other than 0, but I could test if it is honored, in which case, I can add new overloads for UploadPicture

Comment 14 Stephane Delcroix 2006-07-31 20:30:36 UTC
(In reply to comment #12)

> * picasaweb does not handle the orientation EXIF tag (at least I think so),
> images should be really rotated before upload (AFAIR, I have seen a similar bug
> on the gallery export, but I do not have a gallery to test right now)

I indeed fixed that on GalleryExport and other export schemes. I'll do the same trick on picasa export

Comment 15 Gonzalo Paniagua Javier 2006-08-01 19:11:24 UTC
Btw, gnome-keyring-sharp just landed in mono svn. It's a fully managed implementation of the library that might be useful as an alternative for password storage instead of the xml files.
Comment 16 Stephane Delcroix 2006-08-02 10:07:05 UTC
Created attachment 70063 [details] [review]
updated version

This version add the rotate capability, as requested in comment #12.
Comment 17 Michael Monreal 2006-08-06 10:19:06 UTC
Banshee has also imported a copy of gnome-keyring-sharp into their source tree, I think this should be done here, too.

Hope to see this stuff in HEAD soon =)
Comment 18 Stephane Delcroix 2006-08-06 11:32:25 UTC
I'm ok to store accounts info in gnome-keyring, but do you really thing that it bring a new level of security or it only keep all credentials in one (not-so-safe) place ?

I'm in favor of storing all credentials in one place, definitively, and gnome-keyring is the place to do it.
But don't be too confident in gnome-keyring, and let me give an example: at home, I'm using a wifi connection, and the connection is made bu NetworkManager. So, as soon as my session is opened, my keyring is unlocked. And everyone having physical access to this machine (but I trust my wife;) ) can open gnome-keyring-manager and see all my credentials. Not more secure than having a file read-only for my user ...

Just to remind you that you can't say: my passwords are stored in the keyring, then they're ultimately safe !

Implementing accounts in gnome-keyring is on my todo list for this patch, with having async login to picasa. Both with an equal importance, and I guess that none of them are showstoppers to have this in CVS.
Comment 19 Gonzalo Paniagua Javier 2006-08-06 15:07:47 UTC
This is off-topic here, but... I'm not saying that storing the passwords in the keyring is the holy grial, but keeping the passwords in a text file is definitely worse (imagine your laptop is stolen).

If gnome-keyring-manager can see all the secrets it is because you authorized gnome-keyring-manager to read them. One can also lock the keyring (or all of them) after retrieving what she wanted.
Comment 20 Kevin Kubasik 2006-08-08 16:22:40 UTC
I just tried this out, love it, and vote to get it into CVS asap.

1) There are 2 outstanding todo's, but by leaving the patch here you accomplish next to nothing, other that letting it get more and more bittrotten. If its in CVS, its far more likely to get the attention needed.

2) This is a major contribution from an outsider, upon inclusion, we make him more a part of the community, if he puts all the work into an awesome and well-done patch like this, then never gets included, we lose his potential to contribute more.

3) Gnome keyring is a nice solution, but as with any open source software, if someone really, really wants your account, anything you do cryptographically can be reverse engineered, or brute forced once they have the file, and for something somewhat trivial (like a picasa username/passwd combo) I think much effort beyond that is silly, we should just warn the user that if they save their password, it may not be secure.

My $0.02, but I just think we should get this out their asap.
Comment 21 Gonzalo Paniagua Javier 2006-08-08 17:33:15 UTC
re 3): the problem is that the username/password for picasaweb is the same as for Google Checkout... So we're talking about money here :-). If my laptop is stolen I have time to change the passwords. I'll add support for the keyring after this patch is in.
Comment 22 Stephane Delcroix 2006-08-09 07:05:44 UTC
Kevin (comment #20):
 1) I agree with you, CVS is the place to fine-tune and make final reviews...
 2) :-) thanks for the 'major contribution'. I already have some of my patches in f-spot, and this one is the one that will stop me.

Gonzalo (comment #21): I'm already writing support for the keyring...
Comment 23 Stephane Delcroix 2006-08-09 09:15:14 UTC
Created attachment 70528 [details] [review]
with credentials sotred in gnome-keyring

Find attached my updated version.
As requested, the credentials are stored in gnome-keyring.
Comment 24 Stephane Delcroix 2006-08-09 09:15:14 UTC
Created attachment 70529 [details] [review]
with credentials sotred in gnome-keyring

Find attached my updated version.
As requested, the credentials are stored in gnome-keyring.
Comment 25 Stephane Delcroix 2006-08-09 09:17:00 UTC
require both google-sharp and gnome-keyring-sharp
Comment 26 Gonzalo Paniagua Javier 2006-08-09 15:12:10 UTC
Awesome. Thanks a lot Stephane.

It would be nice if the password was stored as a network password having, for example, a "object" property as "Google Accounts" so that one can have more than one user/password stored.

Also, once the patch makes it way to CVS, feel free to import Gnome.Keyring to f-spot (it's small and is not going to be changing a lot, as it is now feature complete). The same goes for Mono.Google.
Comment 27 Stephane Delcroix 2006-08-09 15:33:06 UTC
I did'nt implemented it as NetworkPassword, but you can already have multiple user/password pairs stored... try it, it works.

But if you say that it's better to implement it in an other way, I'll do it ;)

Is Mono.Google also feature complete ? (caption for images ?)
Comment 28 Gonzalo Paniagua Javier 2006-08-09 15:51:11 UTC
Oh! Nice. I didn't realize that. That fine by me.
I'll add support for picture captions later today. Feel free to ask for anything that's missing from mono-google (email).
Comment 29 Bengt Thuree 2006-08-15 02:43:37 UTC
How do I get the missing dll (google-sharp and gnome-keyring-sharp) into my dapper system. Would prefere not to compile it...
Also, for us to ship this patch, I would assume we need to ship the dll's as well, at least until they are included in mono...
Comment 30 Thomas Van Machelen 2006-08-15 19:07:18 UTC
In reply to comment #29:

We'll probably import the google-sharp and gnome-keyring-sharp code into the f-spot cvs tree until the modules are released as part of mono/gtk-sharp.

I've been changing working on this, so expect some news soon.
Comment 31 Bengt Thuree 2006-08-18 02:10:55 UTC
Managed to get it working...

First impressions... Cool :)

First check. Used the wrong account name (forgot the @google.com) and got the following in the console

System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure ---> System.Exception:
   at System.Net.WebConnection.HandleError ()
   at System.Net.WebConnection.ReadDone ()
   at System.MulticastDelegate.invoke_void_IAsyncResult ()
in <0x000ad> System.Net.WebConnection:HandleError (WebExceptionStatus st, System.Exception e, System.String where)--- End of inner exception stack trace ---

in <0x00158> System.Net.HttpWebRequest:EndGetResponse (IAsyncResult asyncResult)
in <0x00047> System.Net.HttpWebRequest:GetResponse ()
in <0x003f9> Mono.Google.Authentication:GetCookieContainer (System.String user, System.String password)
in <0x00054> Mono.Google.Authentication:GetAuthCookies (System.String user, System.String password, GoogleService service)
in <0x0002f> Mono.Google.GoogleConnection:Authenticate (System.String user, System.String password)
in <0x00064> FSpot.GoogleAccount:Connect ()
in <0x000c9> FSpot.GoogleExport:Connect (FSpot.GoogleAccount selected)


I then fixed my userid and managed to connect, and started to upload a photo. Nothing seemed to happend. Just hanging there... Apparently, it was a large file (original size) 3 MB. Would be nice with an indication that something is happening.

Console states "Started Upload" Upload to what? If this text should be there, perhaps change to "Started Upload to Picasaweb"

I also ticked the "Open album in browser when done uploading" but nothing happend in my firefox session. (Apparently commented out in the code!)

No tooltips in the gui

LoadPreference has no default switch statement.

In all, the code do look very nice and clean, easy to follow. Very good job.
Comment 32 Bengt Thuree 2006-08-18 02:39:56 UTC
Nitpickying...
Perhaps rename the main .cs file to PicasaWebExport.cs ?
Comment 33 Stephane Delcroix 2006-08-18 07:22:28 UTC
The first issue is a Mono.Google crash. I'll try to see if I need to catch that exception or...

The 2nd one, about big files. I did'nt manage to find out the max file size for PicasaWeb.

Console output is for debug only. but I can fix it.

Open album in browser is not connected yet. I'm still wondering if I remove that or connect it to open your public album. (I vote for the second one).

Nope, No tooltips. Do you want tooltips everywhere ?

about LoadPreference, do I really need this:
default:
     //this will never happens
     break;

I'll try to fix some of those asap.
Comment 34 Bengt Thuree 2006-08-18 13:09:29 UTC
Tooltips would be good to have in F-Spot to a much greater extent, at least I think so.

The code as it is now will not break, but imagine you add a new preference, or spell it wrong... the code will crash, but no compilation fault though.

Big files, or many files. Perhaps have a better indicationm that something is happening? Running total of how many bytes been transfered?

Could we reuse the Resize Email patch's function with Tiny, Small, Medium, Large, XLarge, Original and its associated original size and estimated size? Would help a bit I think.
Comment 35 Thomas Van Machelen 2006-08-19 16:05:22 UTC
Created attachment 71203 [details]
Tar containing google-sharp & gnome-keyring-sharp

This tar contains both google-sharp & gnome-keyring-sharp and includes them in the f-spot autotools chain.  To test this out you should extract the tar in your f-spot checkout folder, apply the extracted patch and perform a "./autogen.sh && make"

Nothing has happened to the patch itself, a review is for later ;-)

Thanks,
Thomas
Comment 36 Stephane Delcroix 2006-08-22 08:33:37 UTC
Created attachment 71349 [details] [review]
the same in an unified patch

This version do not contains anything new, but is now a patch (vs a tar).

Also cleaned the build garbage packaged with the previous patch.
Comment 37 Stephane Delcroix 2006-08-22 09:33:42 UTC
Created attachment 71352 [details] [review]
updated version (again)

At least, this version introduce some new things:

something new:
- open in browser checkbox works

minor fixes:
- GoogleExport.cs renamed to PicasaWebExport.cs
- Stacktrace on bad credentials replaced bu a more explicit log message
- replaced the log message 'Starting uplad' by 'Starting Upload to Picasa'
- added a Changelog

and as a remember, this patch contains everything you need to build Mono.Google and gnome-keyring-shaap (thx Thomas).
Comment 38 Stephane Delcroix 2006-08-22 09:44:04 UTC
Bengt (comment #34), 
- I did not add tooltips (yet)
- about the default in LoadPreference: still did'nt add a default. even a typo in a call to LoadPreference will not break anything (the LoadPreference method does not return anything)
- about the indication: when you start an upload, a progress bar is displayed saying 'uploading picture blah' before the upload starts. Do you need something more ?
- about the size: users will prefer setting the size precisely. (not as in send mail patch, where only the file size matters)
Comment 39 Bengt Thuree 2006-08-22 11:47:06 UTC
A small review...
File menu : Export -> Picasa
	Should be Export -> Picasaweb (or something like this)
	
The export window should still present file size I think, although 250 MB is a lot... 
Would it be possible to indicate how much space is left before upload is started?

Perhaps have default resize to a sane size?

Is it to much information to show connecting, loggin on etc in the uploading Pictures window?

Auto Rotate seems not to work. Always rotating.	Since I am also resizing to 400pix
	Perhaps make it disabled if picture is resized?
	
Very few comments in the code...	

Uploading Pictures status window.
Perhaps you can indicate
- To wich album
- Total file size  (still think this might be good, since a lot of web sites have a limited space)

Sorry for a rushed review... not to much time here...
Comment 40 Stephane Delcroix 2006-08-22 19:48:43 UTC
Created attachment 71401 [details] [review]
last one for today

Again, an updated version.

- display quota usage in an human readable way
- set default values for rotate, scale and size
- set the rotate_check to unsensitive when resize is checked
- file menu entry: change from 'Export to Picasa' to 'Export to Picasaweb'

About Bengt's comment (comment #39)
- at the time the upload starts, connect and log on are already done !
- IMHO, showing the album name in the upload dialog will not add any value. At that time, it's to late to change :( (and you can still see it in the export dialog)
- yeah, it could be nice to have an idea of the total exported size for all the export schemes. But I don't think I'll implement it before this patch reach CVS HEAD.
Comment 41 Bengt Thuree 2006-08-23 11:24:31 UTC
Stephane, I really like your patch. It is very clean, and it is very difficult to find something to complain on :)

Anyway, here goes.

Ok, here comes another small, quick and dirty review.

+		public const string EXPORT_GOOGLE_SCALE = "/apps/f-spot/export/google/scale";
+		public const string EXPORT_GOOGLE_SIZE = "/apps/f-spot/export/google/size";
+		public const string EXPORT_GOOGLE_ROTATE = "/apps/f-spot/export/google/rotate";
+		public const string EXPORT_GOOGLE_BROWSER = "/apps/f-spot/export/google/browser";

Would suggest these preference variables are called EXPORT_PICASAWEB_xxxx and stored in /apps/f-spot/export/picasaweb/xxxx

Perhaps modify the if (scale).... else if (rotate)..... else upload... code to
   if(scale) upload_photo (false) else if (rotate) upload_photo (true) else upload...
That is, refactor it to not have duplicated code.

Just after you select File->Export->Picasaweb, f-spot seems to freeze for 10 seconds or so.
No indication is given to user what is happening.

The quota usage indication is very nice, but in my screen I get the following:
"<small>Quota usage :12.2 MB / 250 MB</small>"
Perhaps it is only me, but I would like to have a " " (space) after the ":"
Also, (nitpicking) perhaps Quota : 12.2 MB used, 237.8 MB unused?

Comment 42 Stephane Delcroix 2006-08-23 13:40:46 UTC
Created attachment 71458 [details] [review]
updated version

the latest version so far...

- changed references to google with picasaweb in the preferences
- fix the issue with Quota display, improved quota display
- quota not displayed when not connected

Bengt (comment #41):
- for the 10sec delay, I'll apply bmon's patch to make gallery async to picasa, but not before he's really happy with it. Until then, no workaround, not even a small dialog.
Comment 43 Thomas Van Machelen 2006-08-24 20:11:26 UTC
Nice patch, seems to work flawlessly and the code looks very clean.

I have two comments:
* i would be nice if both the gallery export and google export used the same glade dialog, with the specific implementations being tucked away in two classes implementing an interface (to create the connection, get available albums, upload photos,...) .  But i can't really tell how easy this would be.

* there seems an issue with the way you calculate the used space percentage.  You divide the used quota by the maximum quota; but i guess you have to multiply that by 100 to achieve a percentage.
Comment 44 Stephane Delcroix 2006-08-25 07:39:03 UTC
About the first comment: I actually have plan for unifying a lot of code for all the export dialog, but I keep those for the refactoring that will happens with the export plugin.

And about the second, I did'nt really test it, I'm currently really using 0% of my quota ;) I fix that today.
Comment 45 Stephane Delcroix 2006-08-25 09:46:24 UTC
Created attachment 71577 [details] [review]
The one where percentage means something

fixed the issue raised by Thomas
Comment 46 Stephane Delcroix 2006-08-25 16:03:15 UTC
Created attachment 71602 [details] [review]
The one with the progressbar

As Gonzalo updated the Mono.Google lib this morning, I updated the export to picasa code to use his latest new things.

What's new:
- updated the google-sharp included in f-spot
- fixing removing a blank space in the dialog
- showing the progress during import. Screenshot here: http://picasaweb.google.com/sdelcroix/FSpot/photo#4967218685328162834
- sending comment with photo (not tested yet)

The progressbar needs a bit more work to be consistant (the progressbar should reflect the progresstext).


Please discuss...
Comment 47 Stephane Delcroix 2006-08-25 21:00:53 UTC
check the new screenshot with the solution I'll publish soon: http://picasaweb.google.com/sdelcroix/FSpot/photo#4967294199557783570
Comment 48 Brian Geppert 2006-08-26 01:08:26 UTC
Why hasn't this been put into the main tree?
Comment 49 Bengt Thuree 2006-08-26 01:13:59 UTC
It's on its way :) Its one of the Goals for next meeting. (http://f-spot.org/Meetings)
Comment 50 Brian Geppert 2006-08-28 06:14:20 UTC
Thanks. :)
Comment 51 Stephane Delcroix 2006-08-29 15:27:56 UTC
Created attachment 71837 [details] [review]
The one where the size is approx.

This new one fix the progress dialog and update the Mono.Google code to the latest version available.

When exporting full size images, the dialog looks like this: http://picasaweb.google.com/sdelcroix/FSpot/photo#4968684609954054162

And when exporting resized images, the dialog looks more like that: http://picasaweb.google.com/sdelcroix/FSpot/photo#4968692526880391186

enjoy