Categories
Pivot

Live Labs Pivot meets Flickr for the 12×12 Vancouver Photo Marathon

Guest post by Ole Rand-Hendriksen.

So my brother Morten came to me with this idea about making a pivot project for the 12×12 Vancouver Photo Marathon 2009 where he basically wanted to be able to sort the images in categories, photographer, gender, winners and so on. He hadn’t really looked into how pivot works, but he thought this could be something that I could probably figure out in a couple of hours or something.

I followed the links he gave me to the pivot site and some instructional demo videoes. But i didn’t really have the patience to go through them all. So I did what i normally do; which is take half a look at the specifications and then just try it out.

I started by downloading pivot from www.getpivot.com and looking at how it works, which is still a bit confusing to me because of the seadragon technology and the image sorting, but I’ll get into that later.

Then i started reading about how pivot works, and the data part is actually quite straight forward. It’s basically just xml files where each item has some properties, and in the beginning of the file, it says what kind of properties and if you should be able to use them to sort by.

The more confusing part is the deep zoom collection part, which is the part that makes all the trouble. Basically deep zoom collections aren’t dynamic at all (someone please prove me wrong), which is very anoying. Since it means that you have to host all the images locally on the server where you have the pivot collection.

And then i started to read up on how to make pivot collections. There are according to the pivot site 3 ways of making them;

  1. by using the commandline tools
  2. by using the excel tool
  3. by making the tool yourself.

Since i concidder my self proficient in excel i decided to use that method on this project. So I downloaded the tool and installed it (link).

Then i went on to figure out how to get all the data I wanted from the 12×12 Vancouver Photo Marathon Flickr sets. The easiest way i could think of was to use the rss feeds and try to parse them in some way or other. I ended up using a rss parsing library for python from http://feedparser.org/ and i wrote a very simple script that went through all the set feeds and parsed them into a more usable .csv file.

The print lines were just for debuging.

# -*- coding: utf-8 -*-
import feedparser
import codecs

url = [ *list of urls*]

f = open(” *path to file* “, “w”)
for u in url:
print u
d = feedparser.parse(u)
name = d.feed.title.split(“- “)[1]
print name
num = d.feed.title.split(” “)[2]
print num
for entry in d.entries:
h = entry.links[2].href
print h
t = entry.title
print t
s = num+’, ‘+name+’, ‘+h+’, ‘+t+’\n’
u = s.encode( “utf-8” )
print u
f.write(u)
f.close()

then i imported the data into a new excel file.

The pivot plugin for excel is a bit buggy, so you can’t really import data directly into the fields, but when you have the data in another document, you can just copy each column in where you want it. It takes some time for the previews to load though when you are working with a few hundred images that are all online, so be prepared to spend a few hours doing something else if you try.

Another bug that’s nice to be aware of, is that if you by accident make too many rows in your collection, you won’t really be able to remove it. When you’ve added all the data you want, you just push the publish pivot button, and then save it where you want to. This can also take a few hours. When it’s done, pivot will open and you can view your collection.

Since pivot utilizes Deep Zoom and Seadragon, the images are sorted into a gazillion small files that will take forever to upload to a webhotell by ftp. so make sure you are using as many connections as you can. Also it’s very annoying that deep zoom is almost completely static unless you trick seadragon by using the api like Lang Deng did for deep zoom images with his project, though i don’t know if there’s an easy way of doing something like that for deep zoom collections.

I’ve got some ideas for further pivot projects but I don’t know if they are possible to make yet.

By Morten Rand-Hendriksen

Morten Rand-Hendriksen is a staff author at LinkedIn Learning and lynda.com specializing in WordPress and web design and development and an instructor at Emily Carr University of Art and Design. He is a popular speaker and educator on all things design, web standards and open source. As the owner and Web Head at Pink & Yellow Media, a boutique style digital media company in Burnaby, BC, Canada, he has created WordPress-based web solutions for multi-national companies, political parties, banks, and small businesses and bloggers alike. He also contributes to the local WordPress community by organizing Meetups and WordCamps.

5 replies on “Live Labs Pivot meets Flickr for the 12×12 Vancouver Photo Marathon”

well, now I’ve read through the page you linked to, and some of the posts on the technical discussion. And it still seems to me that Pivot really isn’t dynamic in it self. (though I might be wrong)

From what I see from the examples from the Wikipedia collection, it looks like you have to trick Pivot into using scripts that make a dynamic collection. The whole dynamic part seems to be outside of Pivot. It’s so rigid that you can actually use URLs to find the individual images: http://dynamic.getpivot.com/U3ViamVjdCtBcmVhPXJlbGlnaW9uJTJjK2JlbGllZithbmQrbXl0aG9sb2d5JiUyNVN1cHBsZW1lbnQlMjU9ZmFsc2UmJTI1Q29sbGVjdGlvbk5hbWUlMjU9d2lraXBlZGlh_files/9/0_0.jpg

That’s before the URL-rewrite I think.

So to make a dynamic collection, you have to make the image handling yourself and fit it into the very strict form of the deep zoom pyramid.

I see that the Wikipedia collection doesn’t have layers higher than 9, so the images themselves aren’t really deep zoom. I haven’t really found out if the images are generated on the fly or not.

Making dynamic cxml files actually looks quite intuitive and shouldn’t be that hard once you have an idea about how to make it.
But collection and tile handling is not what i would call intuitive. The hello world example on the bottom of the hosting page doesn’t really tell me that much since it doesn’t really generate any images http://randriksen.net/collections/PivotCollectionFiles/HelloWorld.cxml

And from what I read about it, it’s not supposed to for some reason since it’s really only an explanation of how one could make a collection and tile handler, and it doesn’t really seem to do anything. Which i find sort of confusing since hello world examples usually actually demonstrate that the code works.

I’d really like to see a code example of a dynamic collection with only 3 or 4 images, with the code to a collection and tile handler that I can see and dissect into something usable. It would be a lot of help since I’m not really that into image handling.

I’m gonna dig through http://www.getsatisfaction.com/live_labs_pivot/searches?query=dynamic&x=0&y=0&style=topics and see if i can find something

Comments are closed.