Posts Tagged flickr
Drupal Flickr Module. Now with URLs!
Okay, so I’ve been a bit preoccupied with a couple projects which have slowed my efforts at blogging etc.
In both cases, I’ve been working on websites that leverage the PHP based Drupal CMS. One of those projects is over at http://www.chasejarvisshoeproject.com. That site is basically a small community forum for some folks that are sending a pair of shoes around the world, and taking pictures of them in various locations and situations. Pretty cool. The result of this effort is a Flickr photo pool and a good time.
So, of course a website devoted to a group on Flickr, is going to require some integration with Flickr. Enter the Drupal Flickr Module. When I started using it, this module was still in either an alpha, or beta (can’t seem to remember) and has released it’s 1.0 as of the 25th of March. Throughout the time I’ve been using it however, there’ve been a few functions of the Flickr API which I needed, and the module didn’t support. Those were.
Since the framework of the module did the hard work of making the calls, it was easy to write my own methods which performed these Flickr API functions for me. And as the module developers released new versions, I just copy/pasted my code back into the new file, and went about my business.
Well when 1.0 was released, I took a closer look. It turns out they’d implemented the call to get photos from a group pool, but still nothing for the URL’s. So I figured I’d contribute and write a patch for the two calls I was still in need of. And that, is what you see here.
569,597d568
< }
<
< /**
< * @param $nsid
< * nsid of the group whose pool url will be returned
< * @return
< * The URL portion of the response from the flickr method flickr.urls.getGroup
< */
< function flickr_urls_get_group($nsid)
< {
< $response = flickr_request('flickr.urls.getGroup', array('group_id' => $nsid));
< if($response)
< return $response['group']['url'];
<
< return FALSE;
< }
<
< /**
< * @param $nsid
< * nsid of the user whose photostream url will be returned
< * @return unknown_type
< */
< function flickr_urls_get_user_photos($nsid)
< {
< $response = flickr_request('flickr.urls.getUserPhotos', array('user_id' => $nsid));
< if($response)
< return $response['user']['url'];
<
< return FALSE;
As you can see, pretty basic but I figured I'd contribute. I posted this as a feature request/issue over on the Flickr Module's issue queue, but have yet to receive a response. If nothing else, I can use this to patch the next version. Hopefully it helps someone else as well.
Uploading to Flickr from Picasa on Linux
Posted by RyanG in Linux, Photography on December 14, 2008
When I performed my search for the perfect photo sharing solution, I fell in love with the Picasa desktop application. I even discovered that there is a linux version. However, as you’d likely expect, it didn’t really play nice as far as uploading photos to any photo sharing site other than Google’s Picasa Web Albums.
On windows, there is a great solution called picasa2flickr which passes the desired photo’s to the windows Flickr Uploader. Again, for obvious reasons, this doesn’t work well on linux.
So, having determined that it wasn’t worth my time to pursue trying to get Flickr uploads working from Picasa on Linux, I started evaluating many of the other native options on linux, such as digikam and fspot. While these more easily uploaded to Flickr, and had open API’s, none of them worked quite the way I wanted, so I abandoned my search for a good solution.
Then, on a whim I did a Google search just a couple hours after Andy O’Neill made a blog post about a button he wrote to import photos to Flickr from the Linux version of Picasa, named picflick.
I eagerly (re)installed Picasa3 on my Gentoo box using a beta ebuild found here. Then installed his button.
After playing with it for a bit, I realized a few things didn’t quite jive for me.
1) The script automatically resizes the image before uploading it to Flickr. I prefer to upload all of my images at their original resolution, so this was a bit of a road block for me.
2) The script used a Perl module to upload to Flickr. For the life of me, I couldn’t seem to figure out how to get it authorized with my Flickr account to actually permit uploads. I’m sure if I spent a bit more time and read a few more manuals I could have gotten it right, but it didn’t quite work “out-of-the-box” for me.
3) I’d prefer to see the progress being made, rather than the beeps and tray notifications that Andy’s script provided.
So, I stole the key part of his script, the part which translates Windows paths to *nix ones, and broke down the rest to simply pass the photos on to my preferred linux Flickr uploader, KFlickr
Here’s the contents of my script, including the win2native function written by Andy.
#!/bin/bash
DEBUG=1 # debug to $LOG
LOG=/tmp/picflick.log
PICASA_WINE_DIR="$HOME/.google\/picasa\/3.0\/drive_c" # Relative to $HOME
PICASA_WINE_DIR_NATIVE=`echo $PICASA_WINE_DIR |sed 's|\\\\||g'`
function debug() {
if [ $DEBUG -eq 1 ]; then
echo "$*" >> $LOG
fi
}
# wine2native(): convert wine filename to native linux filenames
# Arguments: _name_ of variable which holds path
# Example: wine2native file # not wine2native $file
function wine2native() {
VAR=$1
eval "VAL=\$$1"
debug "Wine path: $VAL"
# use '|' to delimit the paths
VAL=`echo "$VAL" | \
sed "s|C:|$PICASA_WINE_DIR|" | \
sed 's|\\\\|/|g'`
debug "Source file: $VAL"
eval "$VAR=\$VAL"
}
# check we have the required dependencies
which kflickr > /dev/null || die "You need to install kflickr"
file=$1
wine2native file
DIR=`dirname "$file"`
EXT=${file##*.}
debug "START_UPLOAD"
for file in "$@"; do
wine2native file
KFLICKR="$KFLICKR $file"
done
debug "Launching kflickr with the following args $KFLICKR"
kflickr $KFLICKR
debug "Done"
Now when I click the “Flickr” button in Picasa, it brings up the KFlickr app with all the pictures I selected ready to upload. Thanks for the inspiration, and code bits to make this work Andy, I was too lazy to actually figure out what was necessary to pull the image paths from Picasa and use them.
Photo Sharing Services
Posted by RyanG in Cloud computing, Photography, Reviews on September 25, 2008
Since I became a dad, and bought a dSLR I’ve been trying to figure out the best way to store and share my pictures of my son, and other interesting stuff I shoot. As far as securely storing it locally, I have a sizable RAID setup that handles redundantly storing my pictures on two drives, but it’s the sharing part that I’ve had some trouble with.
Initially, I was using my own web host and the rather nice PHP based SPGM photo gallery software. The problem though, is that it’s fairly tedious to resize and upload the images (I wrote a whole blog post about it here), and I have “only” 20GB of storage and 500GB monthly throughput. When shooting at 10 megapixels I could fill that space up quickly. Beyond that I knew that some of the web based sharing sites out there had some really cool features for sharing and organizing your photos.
So, the search begins. I had some (I thought) fairly simple requirements. I was hoping to have these requirements met by a free solution, but I was willing to pay a nominal subscription fee if I got everything I was after. Here’s the run-down of what was important to me.
- Ability to upload original sized images. Some services have a limit to the size of each image
- Unlimited storage/uploads
- Sophisticated organization features. This means unlimited “albums” and the ability to have an “album” hierarchy and probably some other stuff that the service would surprise me with
- Ability to use my images on my website, blog, forum posts, etc.
- Ability to have a gallery on my site which displays all of the public images from the photo sharing site
That’s a fairly short list, and seems as though it should be fairly easy to match but surprisingly it isn’t.
So let’s break down the services I tried and how they stack up. First, let me say that I did not try every service out there, I ruled some out just based on their feature set, some due to their obscurity etc. Listed here are just the ones that I either discovered myself, or were directly suggested to me. If you want to do your own search and want to see all of the services available, here are a couple links that I found useful during my search.
Picasa
This was a fairly natural choice for me since I’m a pretty heavy user of Google services. I use Gmail, Google Reader, Google Analytics, Google Calendar, Blogger (switched from blogger to wordpress), Google Docs, and YouTube. Additionally, Picasa has a great desktop tool for uploading photos that acts as a great photo management tool on your local system as well.
Unfortunately, Picasa only allows you to organize your photos into albums with no hierarchy. Also, while you can upload a photo in it’s original size, the number of photos you can store is limited by your storage space. You’re given 1GB of space for free, and you can buy additional space on a yearly basis. But again, shooting at 10 megapixels means I’m going to need a whole lot of storage space, and I suspect that even their 400GB plan for $500 a year would become insufficient sooner or later.
To be honest, Facebook is actually what warmed me up to the idea of using a photo sharing service on the web. So while it’s technically not a photo sharing service I thought I’d talk about what I did and didn’t like about the photo storage and sharing options it had.
First, I loved how easy it was to upload pictures and tag the subjects in the photo. Facebook also had no limit to the number of photos I could upload. Of course, those photos were downsized to a much more reasonable 604×404px, and their album hierarchy was also flat. And perhaps the most annoying thing was that I couldn’t share my pictures on my own web site and the galleries I made public I had to link directly. For instance I can send you to my public album of artistic shots but I can’t send you to a page that shows all of my public albums on Facebook. If you had a Facebook account, and were added as one of my friends you could see them all, but that’s cumbersome.
Snapfish
Frankly, I didn’t get very far in evaluating this service. There wasn’t much public information about the services offered, and it had a requirement of buying some product from them at some specified interval in order to keep your account active. As such, I never even signed up or tried it.
And the winner is….
Flickr
As it turns out, this had all of the features I wanted, plus some ones I didn’t realize I wanted until I used them.
First, the negatives. With a free account your only allowed to upload 100MB of files each month, and you’re limited to 3 “sets” (Flickr’s version of an album). Also, you can’t technically have a multi-level hierarchy of sets but there are ways to overcome that (more on this later). Of course, those limitations are removed as soon as you buy a “Pro” account which is a paltry $25 per year. Needless to say I went with that.
Now the good stuff! While you can only have a flat hierarchy of sets, you can create “collections” which contain sets or other collections. These can be nested up to 5 deep. This more than handles my organization needs. For instance, I’d like to categorize all of my pictures of my son, then break it down into particular types of events, then the specific event. Something like “Baby Pictures -> Firsts -> Crawling, Walking, Solid Food, Etc.”.
And if that organization is not enough, you can also tag a photo with keywords that are search able by the community, and act as a sort of metadata for organization.
Built right in is the ability to use your photo in a variety of sizes on your blog, forums, website, or whatever you like. Even more exciting is that there are plenty of options for sharing your pictures on other sites, as well as a public landing page for you. They even offer an open API which I’m sure I’ll find useful eventually!
So there it is. After a fair amount of time spent searching I found the solution that works best for me. Hopefully my comparison can help you if you’re searching for a photo sharing service.