[start tech stuff]
To follow up from yesterday's venting post about Java, here is a bit more info for those of you who might be interested. I have been working on a PNG encoder in my recent spare time that allows for the creation of PNG images, written out to a specified file, in a streaming manor. i.e. you create the streaming encoder object, tell it about the image you want it to produce (height, width, encoding type, compression hints, etc) and then you call the encode method while passing it an inputstream. The encoder then reads data from this inputstream and builds your PNG for you, buffering out data to the file as it goes.
There are two reasons for me wanting this.
A) I didn't want to overhead of having to build and encode very large images (6k x 6k pixels or more) in memory while storing the source image as well and
B) its always fun to write code that has a direct and colorful result. :)
This past weekend I wrote the bulk of the encoder minus 1 important step in the PNG encoding process ... filtering. The whole time I ran into the issue that the default representation of data in Java (and most languages) is a primitive
int object, which takes up 4 bytes and is a signed number. Well, when encoding PNG's and working with low level image data, few things use 4 bytes at a time. Sometimes things are encoded into 2 bytes. Sometimes less than 1, but almost always your working with single bytes at a time. This isn't that big of a problem on the surface .. just throw your data into
byte objects and move on .... but there are two problems.
1) if a piece of data takes up more than one byte, you have to encode it in network form, which isn't always how it is stored internally and
2) java bytes are signed also even though the data I am representing isn't ... and the conversion of byte data, into byte objects, into ints for math operations, back into byte objects, and to a file as byte data ends screwing up the data from time to time.
I believe I have either fixed the problem in my code through some creative use of bit masking, etc and/or have narrowed down the problem area to a couple lines of code. Hopefully, this week I will be able to fix that and have filtering work properly. I have also run into the problem that the PNG spec isn't 100% on how the filters should be applied when reffering to previous bites, so I will have to still test that.
I am happy to report that the code currently CAN produce PNGs, just as it should, if you turn filtering off. They can be read in every image editor/loader I have tested them on, and that is a very uplifting note. The only problems is that without filtering, the compression algorithms is a fair bit less effective (a test image of all colors can be filtered and compressed as a PNG of around
50K .... my unfiltered and compressed image is about
400K+. Not perfect, but a good start).
[end tech stuff]
Last night, the two product consultants on our team at work were kind enough to take the whole team out to
dinner at a local Indian restaurant in celebration of the work we got done in our last sprint and for how well the demo with the business owners went. It was really very kind of them. Despite a few reservations some of the team had for trying the new food, I think everyone enjoyed themselves and I had a great lamb dish with a mango lassi so I was all set :).
The only downside to this, and the numerous meetings I am getting invites for for the next few weeks from my new company ... is the time away from Emily. You wouldn't think that you could miss someone who you live with, but the days just aren't the same when you both are busy and you don't get to spend some real quality time with them. Hopefully, after Em comes back from STL next week (she is going back for a few days for work stuff and her dad's bday), and the meetings slow down after the two companies are integrated things will get back to normal.
-----------
When I got in today, there was a message waiting for me from a friend of mine who is a Sark consultant out at GE asking for me to give him a call. When I finally reached him a bit ago, he let me know that evidently
I had been given an award. An award from back in November time frame. An award from a team at GE (my old client). An award for my contributions on a project that wasn't my primary project from people I am not 100% I ever met. Very strange and surprising to say the least. Evidently someone really like the limited work I did, so I have a plaque waiting for me. I will have to get some frames and hang it up along with my certification awards and my little SCJP and SCWCD pins at home ;)