Lotus Connections teaches you how to scale images in Java

Lotus Connections is a little bit screwy when it comes to profile pictures IMHO as they are being forced to be square in Profiles (115×115 pixels). In profiles search results however they are scaled to 55 pixel in width and height is automatic…

In my mind portrait pictures are rectangular and not square.

Yesterday this gave me some grief as I was at a customer where I had to write Java code to import pictures in the PHOTO table of the Lotus Connections PEOPLEDB database. The actual importing the pictures into the database is easy using JDBC but the pictures showed up wrongly in Lotus Connections as they were rectangular (200 x 133 pixels). They clearly had to be scaled but how – clearly not manually!

As with many other things you are gifted with Java as it already contains all the pieces you need to scale pictures. I quickly found some sample code on Google to use java.awt for the resizing. The solution was to

  1. Scale the source image from 200 x 133 pixels to 115 x 76 pixels to keep the aspect ratio
  2. Create a new blank white image sized 115 x 115 pixels
  3. Place the resized source image on top of the white image centered
  4. Upload the resulting image to the database as a byte array

Love Java!

My feed has been broken for 2 weeks so here are 5 posts you might have missed…

My RSS feed has apparently been broken for the last two weeks so I’ll summarize the posts from this period below:

Show ‘n Tell Thursday: Configuring Ubuntu for Notes 8 plugin development (2 April 2009)


This weeks SnTT post is about configuring Eclipse on Ubuntu 8.0.4 for Notes plug-in development. I use Notes 8.5 but it should work equally well for Notes 8.0.x clients. Wan’t to develop plug-ins? Well read on and do it on Ubuntu. Notes 8.x runs freakishly fast on Ubuntu. Read on…

Actually this is a cheat post as the steps are almost the same as for doing it on Windows. Most of the stuff has to do with platform differences. My post for doing it on Windows is here. I have updated this guide with steps for Linux. Enjoy!!

LotusLive.com going commercial – what will that mean for Lotusphere presentations?

So I just received an e-mail from LotusLive.com about the beta moving on to be a 45 day trial. What will that mean? Well for me only that I will no longer use LotusLive.com which isn’t too much of a loss for me. The main issue is that I’ll no longer have access to the Lotusphere 2009 presentations which is a shame. I thought the beauty of having the presentations there was that they would remain there… Unfortunately not.