July 25th, 2002

belize
  • brad

S2 in. The home stretch?

S2 is now cleaned up for use outside LJ and it's in CVS.

And I tied it into the user page/gallery display system for a demo (mainly for Mart):

http://www.picpix.com/brad/

That's S2 code running that.

Take note: when upgrading (with cvsreport.pl -u -c -s), you'll have to do it twice... the first one will update your cvs/multicvs.conf file, and then the second time (the -u wouldn't be necessary) all the S2 stuff will copy over.

Mart, look at bin/upgrading/update-db-general.pl for the tables and such, if you're curious.

Basically, we have a concept of a style (with a styleid) that's a collection of layers.

An account has a default style that applies everywhere, unless it's overridden by a gallery... a gallery can either have styleid of 0 (meaning: default style), or its own, including all layers... core to user.

Yes, Mart, including i18n[c] ... so you can have specific galleries in languages different than your primary one. Wish I think would actually be cool: I could have my Deutschland Bilder auf Deutsch. :)

At this point:

bradfitz: finish S2 integration ... UI to edit/pick layers/styles... populating database (system account) from files in bin/upgrading/s2* ..

mart: work on core.s2 and a layout or so.

whitaker: groups UI ("friend" groups, but we won't be using the word friend as often as LJ...)

niko: BML template

evan: Windows client enhancements? It's functional now as is, but minimal gallery support would be nice.

Given those 5 things, we're basically ready for some public beta testing.

After that, it's just polish and extra features.
belize
  • brad

S2 progress

I woke disappointed today, as there wasn't a twenty page email in my inbox from mart about this thoughts on everything in the world, include the core S2 layer for fotobilder.

So, I had to do some of it myself...

Check out bin/upgrading/s2layers/core1.s2 for a very rough start.

It's running, though:

http://www.picpix.com/brad/

Very, very basic.

Mart, plz finish, thanks! :)
gradient
  • flavor

std xml export/import ?

having noticed gallery getting a code contribution that includes an XML export, I was thinking about whether it would be possible for there to be a target DTD that would allow export/import between the various image mgmt interfaces like gallery and fotobilder.

1) allows for a lot easier migration away from gallery for those who'd like to switch to fotobilder
2) xml export/import can be a paid thingy on picpix.com
3) allows for scripts to be written that can do mass-manipulation/big-import/whatever using the lang's existing xml support

the only real initial hurdle I could see if that doing the raw binary data inline would make for some huge xml files, so you'd probably want to either put them in sep. files, still encoded (and probably use something like XLink) or just leave the actual files as "raw" filesystem files and put the filenames in the xml (so the xml becomes just metadata, which could be a very good thing) with the filenames being semi-random and all in the "source" directory (since keeping around a dir hierarchy would really be metadata about nesting, and we want that handled with the xml file).

With the core/base coming together so nicely, it seems like the right time to start with the nice-to-have's like this :)
  • Current Mood
    curious curious
belize
  • brad

Paletted image templates!

I had this awesome idea ...

Layouts will very often require navigation images, right? Like the stuff at the top of this page.

But layouts will also be easily themeable with S2! (you've read the docs, right?)

So, how do we get images to match the color theme?

Simple... the theme defines the images it wants to use, and the accent colors for those images. The images will have to be GIF or PNG (something paletted) and then the server will generate new versions with the colors they want, just by altering the palette tables.

But, to prevent attacks where people generate 2^32 versions of all resources, we only take a styleid in the URL (/system/pic/09902bag/p294; the 'p' is for palette), and the server finds the colors from that. Further, we only do a color transform if the styleid (global, not per-user) matches the user of either of the system account or the user's own account. (so you can't recolor another user's nav icons into your color's theme.... you'd have to copy them first, or wait until they submitted their theme as a system theme, if they did)

Then, we just redistribute a bunch of stock icons with the fotobilder source.

I figure we'll define a color constant in the core S2 layer for what we map to transparent, and we'll call it $*TRANS_COLOR or something.

So, if anybody wants to start coming up with a ton of 2-5 color navigation items, send 'em in!

Compiling S2

I've been trying to compile S2 on windows and can't seem to work it out, but then all build.txt tells me is:
You'll need a java compiler and 'jmk' (Make in Java), available here: http://sourceforge.net/projects/jmk
  • Current Mood
    confused confused
belize
  • brad

S2 status update

Look at bin/upgrading/s2* ... s2layers.dat contains the S2 layers we're redistributing, and the s2layers directory contains the actual source.

bin/upgrading/s2layers/compile-all.pl builds all the compiled perl versions of the S2 ... not everybody will need that. If you don't have the java compiler available on your system, you just won't be able to make new layouts/etc... only user-layer ones. (customizing exciting layers, essentially)

bin/upgrading/update-db.pl -r -p will populate your database with the compiled S2 data.

S2.pm now has a function to load S2 into memory from a db handle.

And here's my index page again, this time getting the S2 from the database, without a hard-coded s2lid, and using two layers... core & layout:

http://www.picpix.com/brad/

Nice colors, eh? The layout defines those as default. (really it'll be black & white later for "supersimple" layout...) Next I'll be making some theme layers for supersimple and making the web UI to let people create styles (a set of layers) including making a user layer, using a wizard that gives people HTML controls for the properties the upper layers reflect.

Man, where is mart when ya need him?
belize
  • brad

More S2 news

Now we got a goat at the top:

http://www.picpix.com/brad/

I bet you're all pretty excited, huh? I am!

Because here's what's going on....

S2 layers can now register image resources. When update-db.pl runs, it'll register these on-disk (distributed) files and allocate gpics for them, saving a mapping from filename to gpicid.

The unique distributed filename, its width/height, and a mapping of which layer property colors should be assigned to which palette indices is then stored in a layer property.

Theme layers can also do this, and because theme layers can override properties of the layout layer, a theme layer can not only have totally different colors for images, but it can also change the images too

Then, in the S2 code, there's a new site-specific built-in S2 function to retrieve a Picture object given a paletted image spec. S2FotoBilder.pm gets a context from the caller (behind the scenes) and can lookup the color values as they currently are for that style.

Then it returns the image object, after it makes a re-colored image and allocates a upic. Or, rather, adds a stub for it, to be created dynamically when the actual image request comes back in a second.

But right now I'm just returning a goat, because it's not entirely implemented.