Party People Tech Details
Skip to main content
Walker News

Party People Tech Details

Buoyant Sultry Party People

Party People Photos was back in action at After Hours last week, and I promised more technical details of the new features. The big change this time around was automatic uploading to flickr. After each photo was taken, it was transfered, processed, uploaded and finally displayed on-screen in the lounges. I ended up re-writing all the transfer and processing scripts to work better, and they all functioned without problem.

After a photo was taken, it was saved to a folder on the capture iMac. A script started by launchd watched the folder and transfered the file via rsync to my workstation. The files were transfered to my workstation rather than directly to the display computers for two reasons.

Photoshop

Photoshop Events Manager Once the files got to my workstation, another script watched the incoming folder and sent all incoming jpg files to Photoshop. We wanted the process all the images to make sure they looked their best. Cameron, one of our photographers, developed a handy action for the photos that would give them more contrast and punch. The easiest way to automate this in photoshop is to use the script events manager to run an action on every file that is opened ( File > Scripts > Scripts Event Manager… ). The easiest way on OS X to get a particular application to open a file is to use the open command with the -a argument. The -a lets you specify the binary that you want to use to open the file. Otherwise, you’re at the mercy of whatever program has associated itself with jpeg files. Here’s the script:

#! /bin/sh



# this script takes files from the 1_incoming directory and tells photoshop to open them

# should be called by launchd which will be watching the 1_incoming folder

# photoshop should be set to perform the action on open new document



while true; do



myls=`ls /Volumes/Patience/_after_hours/1_incoming/`



	if [ "$myls" != '' ] ; then

		for myFile in /Volumes/Patience/_after_hours/1_incoming/*.JPG

		do

			/usr/bin/open -a /Applications/Adobe Photoshop CS2/Adobe Photoshop

				CS2.app/Contents/MacOS/Adobe Photoshop CS2 $myFile

			sleep 2

			mv $myFile /Volumes/Patience/_after_hours/2_incame/  2>&1 > /dev/null

		done

	fi

	sleep 10

	#take care of pesky .DS_Store files, which can pop up from the Finder

	find /Volumes/Patience/_after_hours/ -name .DS_Store -exec rm -f {} ;

done



# added a return on the photoshop open line for clarity in the browser

Every 10 seconds, if there is a new file, and it is a jpeg, it will get sent to Photoshop. Photoshop runs the action, and saves the file to a new folder, again as a jpeg.

I used my workstation for this because it already had Photoshop installed, and I didn’t want to deal with licensing issues on another machine. I created another account that had photoshop set up just right and the launchd jobs start onload. When we set up PPP again for Picasso show, I’d love to be able to do post-processing via imagemagick, since it is command-line, easy to install and unencumbered by licensing issues.

Flickr Uploading

Photoshop has now saved the jpeg to a different folder. This folder is being watched by yet another script, similar to the last. This script does two things: copies the jpegs to our projection machines and uploads them to flickr. The copy process is mostly unchanged, though I used scp instead of rsync, since the I want to copy files one at a time. As with all the rsync or scp transfers, I just made sure I had my keys set up and authorized, and it worked fine.

Uploading to flickr was the trickiest part of the operation, but thankfully flickr provides a great API and there are a lot of libraries that simplify the process. I ended up using phpflickr. I am pretty familiar with php, and phpflickr only requires php4, which is the version of php-cli in OS X. In order to get it working, you have to apply for an API key, giving it write permission. Using your API key and the secret, you generate a token that you can use to upload with (you need all three to upload). Phpflickr provides the scripts necessary to provide the callback URL that flickr needs, even if you’re not uploading things directly from the web. It is somewhat confusing, and I’m not entirely sure I need the callback url, but it works all the same.

With the tokens all set, uploading the photo is as simple as upload, add to group, add to set. To get the ID of the group and the set, I just used the API explorer, which lists the groups and sets I visited. I had to create the set before I started uploading, though it is possible to create a set through the APIs. I also created a function in the upload script that used a word list to generate a title for each photo as it was uploaded to flickr. I am not a fan of seeing photos with names like IMG_4097.JPG, and this solved that and created some fun and funny juxtapositions.

Other notes, future

I enabled printing of all our photos on flickr, so you can now get prints if you want. In the US, flickr and yahoo do the printing through Target, which also happens to be a major sponsor of After Hours. Perhaps that is an opportunity for the future.

I still had some trouble with the camera not acting the way I wanted. Sometimes it would get into a state where it was totally locked, and the only way to reset it was to pull the power by removing the battery adapter; turning it off and on again wouldn’t do it. Due to the way that gphoto2 talks to the 10D, the capture command doesn’t fully finish, so I kill it after a few seconds. I think what was happening was that in some focus situations, the autofocus was taking too long and the camera hadn’t finished capturing when I kill the command. In the future, I am going to experiment with using a manual focus, which will eliminate that problem.

Gphoto2 was also recently updated to 2.3.0, and it now compiles without too much trickery on OS X. However, it hasn’t fixed my problems with capture on the Canon 10D. I might experiment with modifying the Canon class for the 10D a bit to see if I can get it to work.

We also had some problems with the flash not always firing when the camera went. Unfortunately, the flash we’re using doesn’t have an input for a power adapter, so we were running on batteries. It also doesn’t indicate low batteries, leaving us, literally, in the dark. For the Picasso After Hours, we’re planning on jerryrigging a wired power adapter to provide the 6V it requires.

I’ll also be setting up Party People Photos for the Free First Saturday on March 3rd. I think kids will get a kick out of it. We won’t add the photos to the After Hours Group Pool, but we will put them on our Flickr. Watch for it (or attend, it is free).

Get Walker Reader in your inbox. Sign up to receive first word about our original videos, commissioned essays, curatorial perspectives, and artist interviews.