Filed Under (Lotus Sametime, Uncategorized) by Marc Champoux on March-9-2010

Ever since I got the Sametime Business Cards pictures to work …
   

… I’ve started to receive a steady stream of calls from people asking me (a) ”why” their picture is there now and (b) how to update it. Today is not an exception and I got 1 call from someone asking me the usual questions … but this time the picture was not being pulled from the usual place.
   

Here’s the phone call I got …
   

[Phone Rings]

1. Marc [answers] – “Marc speaking, how can I help?”

2. Sales Rep – “Hi Marc, can you remove my picture from Sametime?”.

3. Marc [replies] – “Why”?

4. Sales Rep – “Check this out”.

5. [sound of email typing ...].

6. [new mail sound].

7. Marc [looks at email] – “Well, Mr. X, this is interesting (see modified version below)… that’s not the kind of picture HR would upload … let me check a few things… ”
   

 

Seriously, Where’s that Picture Coming From?
  

So, I checked the main database where our pictures are stored (an HR database). There was no picture for that employee in there. The pictures from the HR database are exported, resized and re-imported into the Domino Directory by an agent that I wrote so this is why I looked in there first.
   

I then checked the Person doc of the employee in the Domino Directory. There was no jpgPhoto field on his document. That confirmed that he never had a picture in the HR Database.
  

At this point, I was puzzled. But as I looked back at the picture, I thought it was funny looking. It looks like he’s mid sentence trying to grab his phone back … and that’s when I remembered that he’s a BlackBerry user.
   

So, I asked him to check in his Personal Address Book (names.nsf on local) for an entry with his name in it. He said that “Yes”, he had an entry for himself which he keeps some personal notes into. His entry also has his email address in it. He opened it up and … presto, there was the picture.
  

He promptly removed the picture from his own entry in his Personal Address Book, saved it and then right clicked on his name in his Sametime Contact list and selected “Refresh Business Info” … a few seconds later, the picture was gone.
  

That’s it … that’s all.
  

So it looks like the Sametime Business Cards feature in Sametime does a lookup on local first and if it finds a match on your email address, it will pull up that picture 1st. Interesting…
   

Addendum …
  

After we got his picture removed, I asked him if he remembered where that picture had been taken. Mr. X told me that it was taken during “one of those nights at the bar” during a Sales Meeting by another sales rep who had grabbed his phone on the table and started to take pictures … so that explains it.
   

Thanks for reading!
  

Marc



Comments
Keith Taylor on March 9th, 2010 at 10:34 am #

Any chance you might share your agent and maybe an entry on how you were able to get it working?

Scott P on March 9th, 2010 at 10:53 am #

Question is, how did the picture get into his entry in his local address book?

Marc Champoux on March 9th, 2010 at 7:34 pm #

Hi Scott,

The picture got into his address book because he’s a roaming user … so it syncs up with his BlackBerry automatically.

I guess the other sales rep at the sales meeting thought it would be funny to add a picture of the other guy to his very own entry. It’s too bad I had to remove the picture of the sales rep because he had one of those “don’t you dare take my picture” expression … he was actually probably saying exactly that when the picture was taken … but after talking with Patrick about it, he asked me to make sure our sales rep picture wasn’t on this blog. Oh well.

Anyhow …Thanks for your comment!

Marc Champoux on March 9th, 2010 at 7:45 pm #

Hi Keith,

Mmmm … the application I wrote is custom made for our own internal HR database and I’m not authorized to share that particular software.

Anyway, it’s so “specific” to us that I’d be really surprised if it would work in any other company.

But … I’ll probably write another article later with snippets of code to help out if you feel like coding something for your own environment.

In the meantime, here’s the “overall” logic …

1. Get a hold of the selected document (in LotusScript of course).
2. Check for an attachment in the rich-text field for the employee picture.
3. Create a DXLExporter object and make it export all the pictures out of the selected documents to a folder on the hard drive.
4. Verify that there is a picture that was exported in the folder of the hard drive.
5. Launch a command to call IrfanView from the command line and resize the picture to a 100xwhatever picture (i.e. keep the aspect ratio).
6. Wait 5 seconds (to give IrfanView enough time to resize the evil 10 megapixel that was attached in the rich-text field).
7. Check to make sure that the resized file exists.
8. Check if it’s under 32k.
9. If it’s under 32k, find the person doc of the employee in the Domino Directory.
10. Once I have the person doc of the employee in the Domino Directory, check for a jpgPhoto field … delete it if it exists.
11. Load the file with the resized picture byte-by-byte in an array with a NotesStream object.
12. Use the “ReplaceItemValueCustomDataBytes” method of the NotesDocument class to write the array of bytes into the jpgPhoto field.
13. That’s it … that’s all folks … do some house cleaning (like removing the 2 files from the folder on the hard drive).

I hope it helps you …

[...] a post I wrote a few weeks ago about Sametime Pictures and another here about a security issue with the [...]

Post a comment
Name: 
Email: 
URL: 
Comments: