Entries Tagged 'projects' ↓
August 15th, 2007 — code, photography, projects
I’ve lately spent some time playing around with the flickr api (yes, I’m a nerd). It’s a neat way of interacting with the photos and the data you might have stored there.
I’ve come up with some Ruby code I thought I’d share, it’s just the logging in and authentication bit, with a sample call; but the plan is to use it to download some of my photos and their associated comments and store them in files or even better in iPhoto. (I’m doing this so I can easily tidy up my flickr account when I want to… at least that’s the current theory)
I’m using Ruby because I’m learning it at the moment, and I thought it would be fun… the code (as is) uses two libraries which you may have to install. One is rb-appscript, which allows you to make applescript (sorry, windows/linux users) calls from ruby (I’m using it to open a safari window, so you can allow the script to make private calls), the other is simplexml
If you’d like to find out more about rb-appscript, here’s a link to a good article on macdevcenter;
You’ll have to get a flickr key and your own secret to use this, and insert them into the following lines of code;
secret = 'YOURSECRET'
api_key = 'YOURAPIKEY'
Here’s the complete listing below;
# Copyright (c) 2007 Chris Horan, mildendomedia.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require 'rexml/document'
require 'open-uri'
require 'xmlrpc/client'
require 'xmlrpc/parser'
require 'digest/md5'
require 'pp'
require 'xmlsimple'
require 'appscript'
include Appscript
include REXML
# Change the API-KEY and secret to the one provided to you by flickr
secret = 'YOURSECRET'
api_key = 'YOURAPIKEY'
# Create an instance of the flickr service this will return a frob string
server = XMLRPC::Client.new2("http://api.flickr.com/services/xmlrpc/")
digest = Digest::MD5.hexdigest(secret + 'api_key' + api_key)
result = server.call("flickr.auth.getFrob", {
'api_key' => api_key,
'api_sig' => digest}
)
frob = XmlSimple.xml_in(result)
puts "FROB = " + frob
# Create a login link
api_sig = Digest::MD5.hexdigest(secret + 'api_key' + api_key + 'frob' + frob + 'permsread')
login_link = "http://flickr.com/services/auth/?api_key=" + api_key + "&perms=read&frob="+ frob + "&api_sig=" + api_sig
# Call safari with the link and get user confirmation
safari = app('safari').documents.end.make(
:new => :document,
:with_properties => {:URL => login_link}
)
# puts login_link
# Get a token, once you have a token (and a frob) you can reuse this without having to go through the authentication step
digest = Digest::MD5.hexdigest(secret + 'api_key' + api_key + 'frob' + frob)
result = server.call("flickr.auth.getToken", {
'api_key' => api_key,
'frob' => frob,
'api_sig' => digest}
)
auth = XmlSimple.xml_in(result)
token = auth['token'].to_s
puts "TOKEN = " + token
# From here on in you have the ability to make any authorised call on the flickr api
# As an example we can just call 'flickr.photosets.getList' which will return a list of photosets
digest = Digest::MD5.hexdigest(secret + 'api_key' + api_key + 'auth_token' + token)
result = server.call("flickr.photosets.getList", {
'api_key' => api_key,
'auth_token' => token,
'api_sig' => digest}
)
photosets = XmlSimple.xml_in(result)
# Print out the photoset title and it's associated id
puts "----------------------------"
photosets['photoset'].each do |photoset|
puts photoset['title'], photoset['id']
end
puts "----------------------------"
# Let's choose a photoset id to list all the photos available in that set
puts "Enter your choosen photoset id: "
photoset_id = gets
digest = Digest::MD5.hexdigest(secret + 'api_key' + api_key +'auth_token' + token + 'photoset_id' + photoset_id )
result = server.call("flickr.photosets.getPhotos", {
'api_key' => api_key,
'photoset_id' => photoset_id,
'auth_token' => token,
'api_sig' => digest}
)
# print out the returned xml
puts result

July 10th, 2007 — photography, macro, projects

Busy doing some other projects of late; and haven’t had the chance to post many updates.
Did manage to fit some time in to search around for some new macro subjects; plastic soldiers seem to fit the bill at the moment.
June 13th, 2007 — photography, macro, projects

Taken using a 50mm lens and 68mm extension in combination. Depth of field becomes pretty tight.
June 6th, 2007 — photography, projects
1. Pay homage to one of your favourite photographers.
2. Photograph some hands; working, not working, muddy ones, wrinkly ones, soft ones, small and large.
3. How about photographing feet?
4. Go Black and White for a day. Get back to the old days… You could set your (digital) camera to do this, but since you can do it pretty easily in most photo software, it might be an idea to just try out every photo as a B&W image.
5. Saturate everything with glorious colour. (Good job you didn’t use the B&W setting on the camera eh?) This can work really well if you have images containing just a few complimentary colours.
6. Play with the hue… if you’ve always wondered what it does.. check it out. It basically cycles through the colour palette, reds become yellows, become greens.
7. Take pictures from a moving vehicle, such as a car or train; please don’t do this while driving a car… you’ll be busy with the camera. Pick fast shutter speeds if you want to get some detail, and you’ve got some available light… for obvious reasons; don’t use a flash. Shooting from the side window, things are going to get plenty of motion blur, particularly those objects which are closest to you. Pointing the camera towards the front or back will reduce blurring. At night, with longer exposures, you can get some interesting effects, with the trails of head lights being the most intense light source…

8. Take some abstract shots; out of focus, long exposures, you name it… includes the occasional mistake which can make for an interesting image.
9. Abstraction again; this time go in close. Look for interesting surfaces, wood, bark, peeling paint, or rusting metal can all have intriguing patterns and textures.
10. Last one; number ten is maybe the most important… Have fun!
May 29th, 2007 — photography, projects
I’ve just started a new group on flickr called 37fotos. Here the idea; Sometime in the late eighties Paul Horowitz, one of the pioneers of SETI, declared that they had received 37 signals indicating signs of possible intelligence. 37fotos is our answer back, put in picture form, rather than a spike in the static of deep space.
So, this is the theme; what sums us, and the planet we all share, up?
Do we simply just show our beauty and that of the world? Our laughter, our diversity of culture, our simple kindness to one another, the beauty of the natural world?
Do we also show the ugly side? Our wars, famines, and poverty?
How do we paint an image of ourselves to someone who has never met us?
How do you choose your 37 fotos ?
May 25th, 2007 — photography, macro, projects
Gear
A Camera.
Pretty much an essential item. Many digital compacts have a macro feature. Similarly many SLR standard zoom lenses also have a macro facility. So, using this is fine. In fact, I recommend giving it a go without buying any extra equipment if you can.
However, if you feel that you can’t get quite close enough with your current set-up, there are a number of options open to you.
Reversing rings; which allow you to mount a lens the wrong way around, so it will focus that much closer.
Extension tubes; tubes which extend the distance between the lens and the film or camera sensor. This is actually a pretty good option, and if you’re interested in doing it on the cheap, then check out this link on photocritic.org.
Supplementary close-up lens; a lens which fits on the front of your existing lens in much the same way as a filter would. One thing to remember with these is that the image quality will suffer a bit, since you’ve now got an extra bit of glass between the film/camera sensor and generally the optical quality of these lenses is not particularly high.
If you’re really serious about your macro photography, it might be worth considering the various specific macro lenses that are available, unfortunately these can be rather pricey.
A light source of some kind.
It’s always handy to carry a small pen torch if you’re out about and on the hunt for some good macro pictures. The ones where you can focus the beam of light by twisting the torch head are good. If you’re indoors you could probably organise a desk-lamp. You might find that sunlight is illuminating your chosen subject just fine, and if that’s the case go with it.
A Tripod.
A tripod is always handy. Though unless it’s very heavy, you’ll probably have to use some kind of timing feature on the camera, a shutter release cable, or remote shooting if available.
If you don’t have one, make sure you’re throwing plenty of light on the subject, so you can use reasonably fast shutter speeds and avoid camera shake.
Another tip is to hold the camera in such a way that it’s stable in your hands, hold elbows into chest or lean against the ground or a good solid object. It’s best if you can place the camera on something solid. It’s a good habit to get into with most photography anyway, but especially so with macro shots since you’re magnifying a subject, any shake is similarly amplified resulting in a blurred image.
Some card to use as reflector.
A small A5 piece of card is good. It’s worth considering some tinfoil also. (Tinfoil can throw quite harsh light, which can give some interesting effects)
Coloured tissue and some elastic bands.
These are useful to stick over the head of the torch, since they can be used to diffuse the light coming from it. Different colours can be good depending on the subject.
Choose your subject
The joy of macro photography is that you begin to consider the small rarely noticed aspects of objects in the environment around you. Once you take a few macro shots and get some decent results, it’s a area of photography that you always return to.
So, what sort of subjects can you shoot?
Flowers and plants; nothing wrong with a few pictures of flowers. Plenty of colour, and interesting shapes.
Insects; the simultaneously amusing and annoying thing about many species of insect is that they don’t tend to stay still for very long. They do, however, make for very interesting subjects.
Anything (obvious limitations and interestingness considered); the world just looks different when you see it up close.
May 21st, 2007 — macro, projects
Just lately I’ve become a little obsessed with the macro feature of my new compact digital.
