Tuesday, December 15, 2009

Gallery Book

I've been busy over the last 10 days reediting older material to form a book on writing HTML galleries for Lightroom. I'd written quite a lot of it before, but the code base was out of date, so essentially I'm rewriting the code and adding on a lot more to it. I'll be presenting it to my publisher when complete, and if they don't want to take it, I'll look at the e-book route.
The book includes the plugins being created at various stages, so you can look at what's happening and form a reference for future plugins. It's not meant to replace the SDK, but to compliment it. I've written it to work by example, rather than hard core API material. Along the way I'm adding in tips and workarounds for things. For now this is one of 2 or 3 core projects I'm working on, so if things are slow here, you know why!

Labels: ,

Sunday, November 15, 2009

Doing It The Hard Way

This post is a bit geeky/nerdy, so don't feel obliged to read it!

At the start of October, Tweetphoto changed their API. As most folk know nothing about code, it's kinda like they changed the combination to the lock. That meant loads of whinging from me as the old API did everything I needed. I think that made them add a new section to the API for me, but alas I couldn't get it to work. There was loads of back and forth, and I'm sure my frustration was showing. They were patient with me, but I still couldn't get an upload going. All the code seemed perfect, in line with the new API, but no joy, I couldn't upload. So I did what any good quitter does and gave up.

I'd already promised a cross grade to any user that wanted to go to Twitpic, so there was an out in that form. Still I wasn't happy with that. So the other night I started tinkering again. I commented out the optional sections of API until I got an upload. This little success led me to fixing my issue, which, believe it or not, was down to a misplaced space. With upload working, I considered myself done. Just as I was about to go to bed, I figured I better check the error list, and make sure it was parsing correctly. Disaster. Garbled internal error messages. I was a bit distraught, coming down quickly from the ecstasy of getting an upload again. I sent out feelers in a few directions for help. I left the code and started back to work on a new Web Gallery that I was building to create my new website: SkyWaterLand.com.

The Tweetphoto guys came back telling me that the I probably wasn't going to get any XML error codes back from this API, but to check the HTTP status codes. Of course I couldn't see what was coming back as the log didn't show anything. Eventually I had a peek at my Twitpic code and noticed I'd left out a line to print the log.. Doh! After inserting the code, I was able to see the exact error coming back in the Console. It wasn't an actual HTTP/HTML response as I expected, it was simply 'Bad Request'. Well that meant that I needed to search for 'Bad Request' and trap that error. So all seems well now. Of course the code needs to be compiled again and tested, but I'm glad I'm at least to that stage again after having practically given up.

Labels: ,