I like the picasa web photo album, however I dont like Picasa itself. The Uploading on the webpage is to complicated. So I hacked(!) together a small python snippet which is using the Google-API to upload an image from within XNView.
See: http://code.google.com/intl/de-DE/apis/ ... t_lib.html
All I have to do now is press ALT-1 with one or more images to upload. I used "Open With..." (hope thats the term in the english version) and pointed it to my .bat
pifoto.py
Code: Select all
# pifoto.py
# use at own risk!
import gdata.photos.service
import gdata.media
import gdata.geo
import sys
import os
# Fill in!
email = "cw@XX.YY"
password = "YYYY"
#print "Retriving information ..."
#albums = gd_client.GetUserFeed()
#for album in albums.entry:
# print 'Album: %s, number of photos: %s, id: %s' % (album.title.text,album.numphotos.text, album.gphoto_id.text)
# print '/data/feed/api/user/%s/albumid/%s?kind=photo' % ("default", album.gphoto_id.text)
# photos = gd_client.GetFeed('/data/feed/api/user/%s/albumid/%s?kind=photo' % (username, album.gphoto_id.text))
# for photo in photos.entry:
# print 'Photo title:', photo.title.text
# Fill in!
# get the id with the code above!
defaultalbumid = "YYYYYY"
username = "default" # let this alone...
if len(sys.argv) < 2:
print 'Nothing to do!'
sys.exit()
else:
for image in sys.argv[1:]:
print "Argumente: ",image
print "Logging in: ",email
gd_client = gdata.photos.service.PhotosService()
gd_client.email = email
gd_client.password = password
gd_client.source = 'pifoto'
gd_client.ProgrammaticLogin()
for filename in sys.argv[1:]:
path,image = os.path.split(filename)
picfilename = path+"\pic_"+image
print "Uploading photo: ",image, path
nconvert = '"C:\\Programme\\XnView\\nconvert.exe -out jpeg -resize 1600 1200 -ratio -sharpen 12 -rtype lanczos -q 90 -o %s %s' % (picfilename,filename)
os.system(nconvert)
album_url = '/data/feed/api/user/%s/albumid/%s' % (username, defaultalbumid)
photo = gd_client.InsertPhotoSimple(album_url, 'New','',picfilename, content_type='image/jpeg')
pifoto.bat
Code: Select all
C:\Programme\Python25\python.exe pifoto.py %1 %2 %3 %4 %5 %6 %7 %8 %9
Things I would like to add but don't know how:
- get descriptions and other tags from XNView to the script
- mark uploaded photos in XNView
- do the resize in XNView
- ...
Carsten