What a Pain!

After setting up and theming Gallery2, my next step was to import all my old photos. This is over 2000 photos in dozens of albums, so I figured it was worth my while to write a migration script. (This is as big a job as many things I’ve done at work, so I figure I get to use “enterprise” software terms.) I also foolishly figured this would be fairly straightforward given I was working with a mature, open source product instead of my own homebrew hacks.

In reality, the 20/80 rule quickly took effect: the last 20% took 80% of the effort. I was able to modify the import script fairly logically to use photo captions and album descriptions from my previous  system. The devil proved to be timestamping the albums. Their API provided a function to reset it after getting a lock on the album, but it didn’t actually work, and my post to their development forum went unanswered. So I set about doing it the hard way, which was, well, hard. (I had to dig much deeper intro the onion that is the Gallery2 code and ultimately modify some of the base classes to set the timestamp at creation.)

It was a frustrating enough experience to make me wonder why I even bother, particularly when I’m likely the only one to care about the level of detail in everything having the proper date. Though I suppose that’s one of the advantages in being your own customer: no one will criticize you for running over schedule or failing to deliver enough “return on investment” or “earned value”. I also did learn a good bit of PHP in the process, making this a worthwhile investment since I’m sure to continue hacking PHP systems like Gallery2 and WordPress.

Share |

No Responses to “What a Pain!”

Leave a Reply

Comment Policy