I'm now using OSX Finder's webdav support for uploading photos to my plone website. The generic ATContentTypes photoalbum view suits me just fine . I had just two problems with this:
name-of-image.jpg
..DS_store
files that webdav leaves around. (I missed that problem).I've written a small helper script that goes through my photo directory that removes the temporary files. It also changes the title of the files if the title is the same as the id: it removes the .jpg
extension and it replaces the -
and _
with a space: instant good titles, assuming you name your files in a sane way. That last one is a good idea anyway as it is important for google.
Here's the short script:
# We do our work in '/plone/photos' # OSX webdav leaves files starting with '._', kill them off. # Finally, give files with title=id a new title, removing .jpg, # dashes, underscores, etc. LOCATION = '/plone/photos' REMOVE_START = '._' catalog = context.portal_catalog image_brains = catalog(Type='Image', path=LOCATION) print "Found %s images." % len(image_brains) for image_brain in image_brains: id = image_brain.id title = image_brain.Title image = image_brain.getObject() if id.startswith(REMOVE_START): image.aq_parent.manage_delObjects(ids=[id]) print "Removed %s" % id continue if id == title: title = title.replace('.jpg', '') title = title.replace('.JPG', '') title = title.replace('-', ' ') title = title.replace('_', ' ') image.setTitle(title) print "Renamed %s to %s" % (id, title) return printed
Note that I don't have a digital camera yet. I'm mostly scanning old photos at the moment, primarily for my own enjoyment, but also as others might like the photos. The family photos are of course only interesting for my family, but for instance the train part part is also intended as a target for google: people searching for just the specific locations that I photographed. The locations are specific, but the amount of googlers is big :-)
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):
or am i confused. please help been looking at how to do this forever
thanks!