Photo Thing*, day two and more SQLite annoyance

hex on 2006-04-15T21:32:30

Okay, this is hardly on a par with the Pugs diaries, but then again I'm not a fucking scary genius like Audrey. Bear that in mind, sunshine, alright?

Anyway. After another six or so hours of hacking away on and off I now have a super-basic photo album system working, complete with tags. Although at present if you want to put photos into it you have to do it with SQL. By hand. But it works. Obviously sorting out out a tool for that is the next step.

My to-do list after that:

  • thumbnailing on upload
  • use real templating system instead of Just Printing Shit Directly
  • better URLs, none of this x.cgi?foo=bar rubbish
  • per-directory and per-photo annotation
  • RSS feeds: all photos, per-tag

Talking of SQL, I discovered on the way that SQLite changed binary database formats again in January. Of course, the way I discovered it was an SQLite error message: "unsupported file format(1) at dbdimp.c". This caused me no small confusion, since I'd created the database with a freshly-downloaded sqlite3 binary. I eventually found out via careful Googling that the format had changed and worked out that I needed a newer DBD::SQLite. But honestly, how hard would it have been for the SQLite guy(s[?]) to implement some form of version number parameter in the format? An error saying "This database was created by a newer version of SQLite" would have been much more helpful.

* This is my thrilling code name for the project. "use PhotoThing;" - so elegant, no? (Er, no. - Ed.)


Distributable SQLite files...

Alias on 2006-04-15T23:26:36

OK, so SQLite files are forwards-compatible.

And yet DBD::SQLite keeps upgrading to meet the new versions.

What I've love would be a DBD::PublishableSQLite, so that I could generate SQLite database using oldest version of SQLite compatible with the current version, and then anyone with anything newer could read it.

compatibility

jerakeen on 2006-04-16T10:18:48

I thought the only change was to BLOB columns. What are you putting in BLOBs for a gallery application?

Also, I really like Image::Imlib2 for generating thumbnails. Way nicer to use than ImageMagick.

Re:compatibility

hex on 2006-04-16T11:33:10

Oh, I'm not using BLOBs. I just had the confusing situation of DBD::SQLite apparently not recognising a database created by the latest version of the sqlite3 app.

Thanks for the tip - I'll definitely check out Image::Imlib2.

Oh, and thanks again for many happy years of YAPI. :)

Maybe use F-Spot?

mugwumpjism on 2006-09-06T14:52:48

F-Spot has a *very* nice gui for this already. If you could get that to export its information to a database, then you'd have it...