/OPENSTUDIO-archive

Code for the OPENSTUDIO project archive

Primary LanguageRuby

Welcome to the OPENSTUDIO archive

This is just the bare scaffold really. Maybe more will come if people help out. Wink wink.

It’s Rails, yada yada. All images are just generated ahead of time. Would be cool to have automatic png creation…

Data

Not included here is the actual OPENSTUDIO data. We’re not going to publish this, but you can get it from Kelly or me. The data is currently two directories

  1. a set of svg files, named by original OS id.
  2. a set of .meta text files, with meta info

Meta data

I’ve written a db/seeds.rb script to read in the meta data and throw it into the database.

$ rake db:migrate # creates the database
$ rake db:seed    # runs the seed script 

The seed script currently assumes the data directory is openstudio.data/{svg,meta} in the same parent directory as the rails code. Feel free to move around somewhere else.

Image data

For the svg images, you’re going to have to do a little work to batch create the png files. I did it with rsvg-convert, which comes with Imagemagick.

$ cd path/to/openstudio/data/svg
$ mkdir ../300
$ for i in *; do rsvg-convert $i -w 300 -h 300 -a -o ../300/`echo $i | sed -e 's/svg$/png/'`; done

f’sweet.