EDIT (9/28/2009): I pulled the sourcecode out of the post as it was far too long. I have also updated the download package with a couple of important fixes.
I just recently started playing with SmugMug and am really liking it so far. One of my complaints so far is the upload process. Let me be clear here…they have many upload options and odds are good that those options work for the majority of people. But I’m not one of them. Basically I want to be able to keep my online galleries in sync with the photos on my computer and I didn’t see an easy way to do this with the available options. Fortunately, SmugMug provides a solid API and many people have written tools that make use of it. I looked through what people have already written and unsurprisingly didn’t find one that did exactly what I wanted. I did find phpSmug which is a PHP class that makes using the api extremely simple.
Over the course of two days, I have written 2 separate (but related) uploaders that handle the things I need them to. Both require an API key and a valid SmugMug account. These aren’t necessarily the prettiest code I have ever written, but I think they work pretty well.
Download full (UPDATED) package
This one is a fairly simple uploader. You give it the name of an album and a list of pictures to upload and it will upload any files that don’t already exist, replace files that do exist and update the metadata for those files.
This is the one that will keep a filesystem in sync with SmugMug. Point it at a folder and it will create categories, albums and handle the uploading (in the same way as upload.php).
This is a quick way to delete categories. Mostly I made it for while I was testing, but as there doesn’t seem to be a way to delete categories through the SmugMug UI this may be useful to someone.
Standard disclaimers apply to all of this. If it somehow causes the world to end or any other undesired effect, I take no responsibility. That said, it works pretty well for me. If you find any problems, let me know and I will update what I have posted.
Download full package
In my never-ending quest to find the ultimate in online photo management tools, I am currently trying out SmugMug. Currently all of my images are self-hosted as I like the control that gives me. After a recent event however, the software I’m using (ZenPhoto) started choking on my uploaded images. This isn’t really ZenPhoto’s fault as it wasn’t really designed to deal with 10 megapixel images uploaded at full resolution. I considered uploading resized images, but I really like having the full quality pictures available anywhere. As such, I started investigating other options…
Since I generally prefer self-hosted, I started out looking at my options there. There are a LOT of options in the PHP photo gallery world. Things I tried in no particular order:
- There were a lot of things I didn’t really care for in this one. The administration interface was unintuitive and uploads were a pain.
- I was curious about this one as I have used CakePHP in the past and enjoyed it. The gallery wasn’t really designed for what I want to do though. phTagr was more about being social then displaying the information in the way I wanted.
- Gallery 3
- This one had a fair amount of potential. Though it is currently still in beta it feels like a very nice product. This one is the successor to the hugely popular Gallery2 software. Gallery2 had a lot of power and suffered for it in terms of performance and complexity. With Gallery3 the team decided to strip out most of the non-core functionality and focus and speed and ease of use. In my opinion, they made a good choice there and have been hugely successful. Ultimately what killed this one for me is the way it stores files. Since Gallery3 copies files into a specific folder structure, you can’t easily modify files in bulk once they are in the system.
There are a lot of other self-hosted options, but these are the ones that looked interesting enough for me to experiment with. After ruling them out, I started looking at hosted options. Hosted services I looked at:
- Pretty much ubiquitous for photo sharing. But not at all customizable. I like customizable.
- Picasa Web Albums
- This integrates seamlessly with Picasa which is probably one of the best photo organizing apps I have used. But again with the lack of customizability.
- No free accounts, but a 15 day free trial. I can do a lot with a 15 day free trial. This one has a large amount of customizability built in. If you don’t like what they have available they let you create a complete theme (I haven’t played with that yet). They also allow you to use your own domain name (on a Power or Pro level account) which I really like. Also, the service uses Amazon S3 for storage and a CDN to get things served quickly. Overall sounds like a winner.
So far in my experimenting with SmugMug, I have been pretty pleased. I will likely end up signing up for their Power level account ($60/yr) which provides all of the features I can forsee needing. File/Album management is less intuitive than I would like, but I will have more on that later.
On the off chance you feel like signing up for SmugMug and want to help me out, my referral code is pJEmU1ps9hXGE
I have finally upgraded to my own VPS. Dreamhost was a great host, but I prefer being able to setup and break everything all by myself. Also, having dedicated resources makes things like photo galleries work much better. As such, 3dgo.net and all of its related sites are now running on a 256 slice from Slicehost. I’m running Ubuntu Hardy with Lighttpd as the web server.
When I was setting up the server I initially used Apache as it is what I am most familiar with and it is pretty easy to get up and running. But when I was trying to use my site, I realized that Apache is far too heavy with its memory usage. Even caching various things there was still not enough memory available for any kind of load. I had used Lighttpd once at work for a Rails app and had heard that it was significantly lighter than Apache. As such, I decided to try getting it up and working. That was easier said than done…
Problem: PHP wouldn’t work
Solution: Install php5-cgi and then activate the fcgi module (not the other way around)
Problem: Multiple virtual hosts by hostname?
Problem: No .htaccess support (for mod_rewrite, mod_deflate)
Solution: No ideal solution for this one really, but you can setup mod_rewrite/mod_deflate rules in the config for each vhost. I prefer the .htaccess method, but this works for now. For most popular apps you should be able to find lighttpd rules to replace the .htaccess rewrite rules.
On the off-chance, you want to signup for Slicehost and wouldn’t mind using me as a referral, here is my affiliate link: https://manage.slicehost.com/customers/new?referrer=de41b271f1865e85d87b32e6996d4ee9
Everyone else is talking about it, so why shouldn’t I? Actually, that’s a terrible reason to talk about it, but I will anyways.
As just about everyone who does anything with computers knows, Google has released a beta of their very own browser called Google Chrome. Currently the beta is only available for Windows, but they claim to be working on Linux and Mac versions as well. I sincerely hope this is the case as after using it for a while on both my work and home Windows computers, it seems to have great potential. Currently it has two major things going for it:
- It separates tabs into different processes. Thus, if one tab is being stupid, it doesn’t destroy the whole browser.
- It is fast. Not just any kind of fast though. Ridiculously fast. If you have the bandwidth to handle it, you will notice a huge increase in page render times.
There are other interesting things about it, but those two are the most pertinent for regular users.
Over the past many months, I have seen many articles explaining how PHP is a bad programming language for various reasons. This one is the only one I have read which gives a well thought out reason for it though.
PHP has long been considered something of a standard in modern web development. Comparatively, Java and .Net have their respective camps, but I’m not sure they match the market-penetration, if you will, that PHP has enjoyed. And yet, PHP feels like an unintutive language.
To me, PHP has been the C++ of the web world. Yeah, it’s powerful and can do pretty much anything, but it doesn’t exactly feel good to code with it.
This seems to me to be a fair statement. The article goes on to explain how Ruby on Rails is a much more elegant language and based on my extremely limited experience with RoR, I probably agree. But my argument against that is this:
Rails is a framework. Ruby is the language. PHP is just a language. A lot of effort has been put into Rails to make it easy to use and that effort has paid off for them. Well enough so that people tend to forget that Ruby on Rails is not a language in and of itself.
There are many frameworks that have been written for PHP. Perhaps the most popular at the moment is the Zend Framework. I have used bits and pieces of this in projects for Cornell and it has done well. Another good one is CakePHP which I have started (though never finished) a couple of projects with.
Working with both of these frameworks is much easier (in some cases) than working with the core of PHP. But at the same time, it is extremely easy for me to put together a quick site using the core of PHP and deploy it on just about any host available. A Rails project (as best as I can tell) requires much more effort to create a deploy.