Photo thumbnail generation in J2ME

I have been working on a photo-application in J2ME. The main challenge turned out to be thumbnail generation. This isn’t really hard to do in the first place, the problem is the limited memory available. Trying to load photos captured with your mobile’s camera will most likely give you memory problems.

There is however one solution, which is to extract the thumbnail stored in the photo’s EXIF. Both Sony Ericsson and Nokia generate and put the thumbnail in the JPEG when you take a photo, but there is of course no guarantee that all photos have one.

The algorithm for extracting the thumbnail should be something like this: (where rByte is the byte you read)

1. Read through byte stream until you get rByte & 0xFF == 0xD8

2. Read thumbnail data until you find rByte & 0xFF == 0xD9

I found the necessary code as part of a slideshow tutorial (look for ImageFunctions.java in the downloadable source code)

Java Service Wrapper

Today I tested Java Service Wrapper by Tanuki Software. Basically it’s software for running your Java application as a service or daemon, and really eases the task of starting, stopping, logging and monitoring your application.

It worked like a dream, and was fairly easy to set up!

New workplace

I’ve now started working at WapTheWeb’s office at Tiller, not too far from where I live. I’m doing some work for them, and they’ve been kind to lend me some space where I can do Microways work too.

The only downside is that the bus takes around 40 minutes, so getting a car might be a good idea…

Mobile Game Webshop

Check out Microways’ mobile game webshop. It has most of our games, both new and old, for sale. It’s easy to pay through Paypal, either by using your Paypal account or with credit card.

Confirmation, 3MX and work

This weekend I went to Asker, near Oslo, to attend my cousin Johanne’s confirmation. The church ceremony was exactly as boring as I thought it would be, but dinner and cakes at Johanne’s place “healed the wounds”.

Back in Trondheim, I’m now ready for a week of mathematics. My brother is in desperate need of help for preparing for his secondary high school exam in maths (3mx).

After a few lazy months, I now have more to fill my workdays with. Some might think it’s best to work a lot during the winter, but I prefer it the other way around since I have a lot more energy during the warmer and brighter period of the year. In other words, my motivation is top notch at the moment!

My next chess event is Trondheimsmesterskapet, starting next monday. It’s a 5 round monrad, classic chess tournament. My goal is 1st of 2nd place.

Speedtest

Check out this cool broadband speed test. Not only does it tell how slow your broadband is, it also has a cool interface. Almost like stepping into the movie Minority Report. Well, almost…

Great result

Not every chess tournament ends with a crosstable that makes you proud, but this one certainly did. Sunday 27th April I played in Bondeofferet GP, a rapid chess tournament arranged by SMPOAÅ. Time control was 25 0, 6 rounds total.

The tournament actually started rather badly. I underestimated my first opponent, a 980 rated kid. Luckily I escaped unharmed. My play impoved throughout the rest of the tournament, but I must admit that luck also contributed to my surprising result. Anyway, I’m happy about my play against Tormod Ingul (SMPOAÅ) and Pål Andreas Hansen (Verdal), both players rated higher than me.

The final standings are here. Now all I need is to print it and find a suitable frame :)

Finally I have a blog too

It was time I got one too, eh? Let’s see if I’ll manage to keep it updated regularly.

Anyway, welcome to my blog!