PHP-CBViewer 0.1

https://sourceforge.net/projects/php-cbviewer/

Version 0.1 is in SVN now.  A README file is pending (I can’t work on this project while at work, so when I get home, I’ll be writing some documentation, including necessary modules, etc).

For the un-enlightened, this project is a PHP-based CBR and CBZ viewer, for reading “comic book archives” in a web browser, instead of in a standalone client.

PHP Comic Viewer

OK, I’m gonna have to start out with a bit of geek-translation and/or explanation.

When you steal acquire comic books off of the Internet, they generally come in one of two convenient formats (or in a very inconvenient format that I don’t care about): CBR and CBZ.  CBR files are RAR files that have been renamed, and CBZ files are ZIP files that have been similarly renamed.  Both archives contain multiple individual image files, which are the pages of the acquired comic.  Traditionally, there are two potential ways to deal with these files.  You can rename them back to .rar or .zip, extract them, and use an image viewer to look at the individual pages, or you can use a specialized program that’s designed to view “comic archives”, which extracts the images to a temporary location and displays them for you.  The latter method is simply several fewer steps than the former.  The “inconvenient” format that I mentioned is “a bunch of images”.  This seems to me like a much more difficult way to manage your collection, increases the possibility that you’ll end up with 22 complete pages out of a 23-page book, and generally makes your life more complicated.  If you’re the kind of person who likes this method of comic organization, more power to you.  But I like the archive method; it fits my needs much more completely.

I was talking to my friend Paul about this a week or two ago, and he mentioned that he’d seen someone with a web-based viewer for comic archives.  Naturally, I spent a bit of time looking for it, because I’m lazy. If I can just load a web page to read comics, I’m 100 times more likely to use it than I am to download & install a comic viewer on each computer I use (please note, I actually have done this; I’m speaking of a theoretical rather than an actual).  I was unable to find such a program, in any language.  So I decided to write one myself.  It’s still in a very alpha state, but here are a couple of screenshots of the devlogic.org cbviewer 0.2alpha.  It uses a couple of what seem like non-stock PHP libraries (for the RAR and ZIP support), but the bonus of this is that it doesn’t use any external programs to achieve its magic; it’s 100% PHP.

  

I recommend clicking the thumbnails to enlarge, because the tiny squares that wordpress auto-generated really don’t do the program justice.  Naturally, I’m still working on the “make it pretty” aspect of designing a web program (aesthetics aren’t my strong suit), but at the very least I’ve managed to get everything working without having to resort to any hacks.  In this version, at least.  In version 0.1a, I was forced to use embedded base64-encoded images to display files that were inside .cbz files, because I hadn’t yet figured out how to extract the image to a temporary (and arbitrary) location without being forced to also include whatever sub-directories were included in the archive.  This had the wonderful side-effect of crashing Safari and WebKit.  0.2a eliminates that problem, as well as significantly tightening up the code, reducing the necessary number of source files from 7 down to 4 (by extending some of my previous logic and discoveries, I was able to make the archive-handling and page generation more generic).

And I think I’m done geeking out for a while, at least on this project.  I’ll probably tweak the CSS some more, in an attempt to make the site more aesthetically pleasing, but by and large I’ve got all but one of the features I want.

Ooh, shiny.

It seems I’ve decided to at least work on the backend of the blog again, if not make a conscious effort to post more often (although I suppose that if I post about every update I make, that’ll at least be something).

I created a new blog for Heather this morning; check it out if you feel so inclined. Only one post so far, but there’s only so much that happens in one day, you know?

So. Theme updates; I moved from K2 (which I still really like) to Tarski. It’s one of the 9 themes on wordpress.org, so I’ll definitely need to change things like the header image, and possibly some of the font settings; I don’t want this site to look like hundreds of other new wordpress blogs that have just moved away from Kubrick.

I also created a bare-minimum plugin for this site which adds OpenID headers to the front page. I figured that manually editing header.php for every theme would rapidly get quite boring. It’s actually amazingly easy to write simple plugins like this. I doubt I’ll ever release the plugin for general usage; in its current state it’s very bare-bones and requires not only multiple manual edits to the plugin file to get it working correctly, but also requires a working installation of phpMyID.

And with that, I’ll be signing off.

Post more often, eh? Well, here’s a three-fer.

I decided yesterday that I needed more delineation between work and home, so I set up an additional user on my iBook. Now, when I’m at work, I can log in as “pleonard”, and when I’m at home, I can log in as “devlogic”.

The trouble is, there’s a lot of files that I think I need access to in both accounts. And sorting through everything is kind of a pain in the neck.

It’s only been a day or so (and I’ve got a cold, so I’m actually moving more slowly than usual), but I think that by and large I’ve got most of it sorted out. I still have to wade through the “Documents” folder, as well as my local source code repository (I should really set up a SVN repository for that).

I found out how to share an iTunes library between both accounts (because I do listen to music at work, and don’t want to limit myself to only what fits on my new iPod touch). I took those directions one step further, though, and chgrp’d the whole directory to “staff” (since both accounts are administrator accounts, that should work), and chmod’d the whole mess g+w as well, so that I can update tags and add new stuff from both accounts.

All of the old iPhoto library moved across to the new username, and I copied all of the ssh settings, because I don’t want to keep track of two separate private keys. My old terminal custom settings decided not to agree with what I wanted, but I decided that the “Pro” profile looked better anyway, so that was a pretty easy adaptation to make.

Ecto moved entirely over to the “home” account, since I shouldn’t be blogging while I’m at work anyway, and since NetNewsWire syncs with NewsGator online, it was really easy to get that working on both accounts as well.

Adium was a bit of a decision to make, because having it in two places means I’ll have two different accounts to sort through if I ever want to search through my message logs. I went ahead & copied everything I had as of Friday into both the “home” and “work” accounts, and I think I’ll just deal with the disparity. That, and the fact that I don’t really chat that much when I’m at home (at least, I haven’t for a good long while). I did delete my work-related IM accounts from the “home” Adium’s settings, though; no sense in tempting myself.

I’m not, however, looking forward to getting my calendar working properly. I think I’ll start by looking for a caldav solution; that way I can just sync both accounts (and the multiple calendars on each) via the calendar server, so updates from either end should show up on both calendars.

Hopefully, when I finally have enough to buy a new MacBook, I’ll have gotten used to this, and will be able to transition well enough without too much hassle. So far, I’m really liking it. I don’t use my bluetooth devices at home (they’re locked in my desk at work when I’m not there), and SynergyKM, while cool, isn’t much use when I don’t actually sit at my workstation. That, and switching between its profiles was tedious, because I’d frequently forget and then start wondering why it wasn’t working.

In other news, I have a beard again. It’s not out of some desire to have one, just more that I’ve been too lazy (or otherwise occupied) to shave. I’m trying to decide if I want to keep it around. I’m pretty sure Heather doesn’t like it, but I remember liking the way the beard made my face look back before I shaved it off a few years ago. Plus there’s the fact that I’m (still) overweight, and the beard draws attention away from my developing double-chin. Oh, well.

I made Pad Thai on Thursday evening. It turned out very good, although the soup that I made to go with it ended up nigh-inedible. Saltier than those liquorices that are on my desk at the office, and not really what I was going for at all. I’ll have to keep looking, because I know I can find a good recipe for a coconut curry soup that doesn’t taste like ass. Anyway, the Pad Thai was very good, although I think next time I’ll just take a few extra minutes to make each portion separately, rather than both at once. It took a little too long to make two servings at once, and the noodles turned out mushier than I like. They were also clumping together pretty badly. But with some (i.e., a lot) extra paprika, it was pretty close to some of the restaurant pad thais that I’ve had in the past. Definitely more flavorful than what I get at Java Noodles, but a lot of work. I think the more often I make it, the more seasoned my wok will get, though, so that’s a big argument in its favor. But fish sauce is both expensive and pretty horrid-smelling, so I may try to find another ingredient to take its place. I’ve got enough tamarind paste to last me until next year, though; one block of tamarind pulp makes a LOT of paste; I filled up a full quart mason jar, and that’s after I pulled half of a cup out to make the pad thai sauce. No pictures of anything, unfortunately. But that’s a good thing; I neglected to clean the kitchen before I started cooking, so it looked like a restaurant supply store had collided with a compost heap by the time I was done. It took 2 loads in the dishwasher plus about an hour of hand-washing before things looked reasonable again.

Bah, back to basics

I upgraded to WordPress 2.3 a few moments ago, and as a result all of the themes I like seem to have broken. So it’s back to the Kubrick variant until I find time to write and/or steal a different theme.