Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

hex (3272)

  (email not shown publicly)

Perl, RDF and wiki hacker, London, UK. This is my former Perl blog; I now write at Earle's Notebook [].

Journal of hex (3272)

Saturday April 15, 2006
04:32 PM

Photo Thing*, day two and more SQLite annoyance

[ #29334 ]

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.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • 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.
  • 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.

    • 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. :)

  • 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...