Facebook Photo Sync

This is a Python script that matches photos on your computer with photos uploaded to Facebook. This helps you link from your blog or web site, to your Facebook photos. It is this script that lets me easily have photos on my blog that link to Facebook.

Using the Script

To use the script, you need Python, the Python Imaging Library, and JPEG Meta. A normal run of the script will take several minutes; if you're worried it has locked, you can use -v to see detailed progress. Go into the album directory and issue:

python fbphoto.py [-v] [-d] [url] [path]
The public URL of the Facebook album. When browsing a Facebook album, this link is shown right at the bottom of the page.
The path to the local photo directory. (default: current directory)
Verbose mode
Debug mode - keeps the fbphoto subdirectory after the script has finished. If you use select this option, you can look at check.html to visually confirm the images were matched correctly.

On all the photos that match an online photo, the script sets the JPEG comment block to the Facebook public URL for that photo.

Using Linked Photos

The main use for the URL is to automatically link to Facebook from your blog or web site. If you build your site using Pipp, URLs in JPEG comments are automatically detected, and a link constructed around the image. If you're using other software, you'll need to add your own hooks, or request the author add this feature.

Another potential use is exchanging more information with Facebook. For example, details who is tagged in the photo could be extracted, and added to the JPEG file. Alternatively, comments made in offline photo software could be posted as Facebook comments.

Future Plans

  • Improve performance in the case there are many FB images that don't match local images
  • GUI interface, progress indicator
  • Is there a better place to save the URL in the JPEG metadata? In particular, it would be good to be able to see the URL in Windows Explorer.
  • Do all albums automatically, in one go
© 1998 - 2012 Paul Johnston, distributed under the BSD License   Updated:03 Jun 2010