All pastes #397734 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-16 18:58 UTC
rendered paste body
kphotoalbum is pretty nice photo management interface. Having your photos for
yourself is pretty boring, though, so let's make a web interface where others
would be able to see them and perform the same searches as you can in the real
application

goals:
* ability to perform extensive searches
* filtering outptu based on a presence of a keyword (ie. people will see only
  pics tagged with keyword "web")
* caching of thumbnails

some hints:
* python's xml.dom.minidom sucks -- for a 2.2MB XML, it uses about 90MB of
  memory and it can't be pickled (screams about recursion shit)
* so let's follow this skeleton:
  1) initialize statistics (parse xml, get <Categories> and <Category> and other
     data)
  2) build a filter condition (checking values for validity against stuff at 1)
  3) for each <image> check the filter; if it matches, let's remember the file
     name and all the associated metadata; with that, we can later show the user
     some options to further filter the selection (yeah, only after we've
     already parsed the whole file -- that means that if user wants to see a
     list of "now available" searching criteria before the file list is
     shown, we'll have to buffer all the matching files (and probably die after
     we've reached some limit for DOS protection... when we "die" in this way,
     we'll output a complete search criteria (some of them might not return any
     matches anymore when combined with current ones), flush the existing images
     to the user and then continue with parsing...))