shahine.com/omar/

homepage | Send mail to the author(s) contact

yet another Microsoft blogger

# Tuesday, January 30, 2007

Researcher Jim Gray missing at sea

[Incremental Blogger: Researcher Jim Gray missing at sea]

Microsoft researcher Jim Gray is missing at sea while on a solo sailing trip. I hope Jim is found soon.

I met Jim randomly at a Microsoft event awhile back and had a highly memorable discussion with him about various technologies and the Tablet PC. He's not only smart as Robert Scoble points out, he's a genuinely nice person.

Other news covering Jim Gray:
Information Week: Jim Gray has "...teacher's patience with my questions."
San Francisco Chronicle: Jim "...apparently disappeared on a day cruise to the Farallon Islands."
Seattle Post Intelligencer: "The Coast Guard searched all night with a C-130 plane"

Oh, this is terrible. Jim Gray is a highly respected computer scientist. Microsoft is lucky to have him. I do hope they find him soon.

Jim was pretty instrumental in helping to build some of the current hotmail backend storage infrastructure.

Posted Tuesday, January 30, 2007    Permalink    Comments [0]  View blog reactions

 

Test Drive Vista

http://www.vistatestdrive.com

Cool. Enough said.

Posted Tuesday, January 30, 2007    Permalink    Comments [0]  View blog reactions

 

Windows Live Messenger 8.1

[LiveSide - News blog : Windows Live Messenger 8.1]

Updates from 8.0 include:

  • Yahoo interoperability - now you can chat to your Yahoo Messenger friends from Windows Live Messenger 
  • Your display name, status and personalization roam with you to any computer
  • Improved sign-in performance
  • Redesigned contact cards
  • A bonus of 2 free VOIP calls
  • And it runs on Windows Vista!

Wohoo!!! bullet #2 is the best. Roaming personal status + user tile.

I've been wanting this FOREVER. It was one of the few features left on my wish list for messenger. The only thing left on the list is away messages.

Another feature I've been waiting for:

Personal Invitation - When you add a new contact you can add a message so they know who you are. Especially helpful if your email address is something like ILoveMessenger(at)emaildomain.com - since there are so many of us out there.

This kicks ass... messenger rocks now.

Posted Tuesday, January 30, 2007    Permalink    Comments [2]  View blog reactions

 

Samsung Customer Support

I emailed Samsung the other day complaining about the bluetooth support on the Blackjack. Specifically:

  1. It does not work with Microsoft Voice Command 1.6, the killer app for the smartphone IMHO.
  2. It cannot be paired with more than one bluetooth headset at a time
  3. If your bluetooth device goes out of range it does not re-establish a connection
  4. Answering a call with a headset when #3 happens is virtually impossible.

Anyway, here is the response I got from them:

Dear Omar,

  Thank you for your comments. I'm sorry to hear about your dissatisfaction with your BlackJack. I will forward your concerns to the appropriate parties for review and consideration.

I am not aware of there being a problem pairing the BlackJack with more than one headset. What happens when you attempt to pair with a second headset? Do you receive an error message?
Your interest in Samsung products is greatly appreciated.
Sincerely,
Technical Support
Samtech217

And here are the options in the email:

* Please do not reply back to this email message as this email address is used for outbound messages only.

* If you are not satisfied with the answer we provided, please   click here

* if you have a question on another product,  click here

Um, so Samtech217, how am I supposed to answer your question?

I see, this is really one way tech support in the form of 2 way tech support.

Posted Tuesday, January 30, 2007    Permalink    Comments [2]  View blog reactions

 

IE 7 tabs and Windows Update?

Last night my Vista PC downloaded some updates from Windows Update requiring a reboot. I had IE open with a bunch of tabs I wanted to read.

This morning I logged on to the machine, and when I launched IE it restored all the tabs from last night.

Is this a Vista only feature? I never noticed it before.

Anyway, it's a welcome feature. I was pleasantly surprised.

Posted Tuesday, January 30, 2007    Permalink    Comments [4]  View blog reactions

 

# Monday, January 29, 2007

Reading XMP Metadata from a JPEG using C#

The other day I was looking for some code that would extract some XMP metadata from a JPEG. You see on Vista, all metadata is now written to the file using XMP for a number of image formats, one of which is JPEG. This is truly glorious as on XP there was no interop story for any keywords, captions etc that were entered into Microsoft APIs (Win32 - GDI+ and .NET System.Drawing).

This is possible because Vista and the .NET Framework 3.0 have a new Photo subsystem called the Windows Imaging Component and it's part of the Windows Presentation Foundation (WPF). This is a subsystem that relies on image codecs to describe the contents of images (like video codecs). These codecs also handle reading and writing metadata.

For Vista/.NET Microsoft has written a number of codecs that ship in the box. This includes:

  • BMP
  • GIF
  • ICO
  • JPEG
  • PNG
  • TIFF
  • Windows Media Photo

Metadata support is described on the Microsoft Photography Blog in this post.

EXIF, IPTC, and XMP – oh my!
There are a number of competing standards for imaging metadata. That is, different ways of reading and writing metadata for photos. One of the biggest standards, EXIF, is commonly written to photos by most cameras, but has many limitations. It’s somewhat antiquated, fragile, not very flexible, and doesn’t support international languages like Japanese very well. IPTC is a standard that is used pretty widely in journalism applications, but is undergoing a transformation towards an XMP-based system.

XMP is an extensible framework for embedding metadata in files that was developed by Adobe, and is the foundation for our “truth is in the file” goal. All metadata written to photos by Windows Vista will be written to XMP (always directly to the file itself, never to a ‘sidecar’ file). When reading metadata from photos on Windows Vista, we will first look for XMP metadata, but if we don’t find any, we’ll also look for legacy EXIF and IPTC metadata as well. If we find legacy metadata, we’ll write future changes back to both XMP and the legacy metadata blocks (to improve compatibility with legacy applications).

Well, what I wanted to do is add some code to Send to smugmug that can read the keywords, ratings and captions that I enter in using Vista as well as Adobe Photoshop Bridge and Microsoft's new iView Media Pro Microsoft Expression Media. However, Send to smugmug is a .NET 1.1 application and all this cool new stuff is in .NET 3.0. Ugh.

After a lot of searching I came up empty handed. It seemed impossible to extract XMP from JPEG. Or so I thought. But I found this hidden gem. It turns out that if you just open the JPEG file and read it in using a StreamReader the XMP text is sitting right there in plain view. Right in the middle of all this binary text.

Here is a code snippet to load a jpeg and extract the XMP section.

public static string GetXmpXmlDocFromImage(string filename) 
{ 
    string contents; 
    string xmlPart; 
    string beginCapture = "<rdf:RDF"; 
    string endCapture = "</rdf:RDF>"; 
    int beginPos; 
    int endPos; 
    
    using (System.IO.StreamReader sr = new System.IO.StreamReader(filename))
    {
        contents = sr.ReadToEnd(); 
        Debug.Write(contents.Length + " chars" + Environment.NewLine); 
        sr.Close(); 
    }
    
    beginPos = contents.IndexOf(beginCapture, 0); 
    endPos = contents.IndexOf(endCapture, 0); 

    Debug.Write("xml found at pos: " + beginPos.ToString() + " - " + endPos.ToString()); 
    
    xmlPart = contents.Substring(beginPos, (endPos - beginPos) + endCapture.Length); 

    Debug.Write("Xml len: " + xmlPart.Length.ToString()); 

    return xmlPart; 
} 

Notice that I am looking for the <rdf:RDF and </rdf:RDF> start and end tags here. This is to ensure maximum compatibility. Normally an XMP blog starts with <x:xmpmeta and ends with </x:xmpmeta> however, this root tag is optional per the XMP spec and for some reason Vista uses <xmp:xmpmeta and </xmp:xmpmeta>.

Once you have the xml extracted from the binary file you simply load it into an XML Document and go looking for what you want. In the below code example I'm looking for Rating, Keywords and Description.

private void LoadDoc(string xmpXmlDoc) 
{ 
    XmlDocument doc = new XmlDocument(); 

    try 
    { 
        doc.LoadXml(xmpXmlDoc); 
    } 
    catch (Exception ex) 
    { 
        throw new ApplicationException("An error occured while loading XML metadata from image. The error was: " + ex.Message); 
    } 

    try 
    { 
        doc.LoadXml(xmpXmlDoc);

        NamespaceManager = new XmlNamespaceManager(doc.NameTable);
        NamespaceManager.AddNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
        NamespaceManager.AddNamespace("exif", "http://ns.adobe.com/exif/1.0/");
        NamespaceManager.AddNamespace("x", "adobe:ns:meta/");
        NamespaceManager.AddNamespace("xap", "http://ns.adobe.com/xap/1.0/");
        NamespaceManager.AddNamespace("tiff", "http://ns.adobe.com/tiff/1.0/");
        NamespaceManager.AddNamespace("dc", "http://purl.org/dc/elements/1.1/");

        // get ratings
        XmlNode xmlNode = doc.SelectSingleNode("/rdf:RDF/rdf:Description/xap:Rating", NamespaceManager);
        
        // Alternatively, there is a common form of RDF shorthand that writes simple properties as
        // attributes of the rdf:Description element.
        if (xmlNode == null)
        {
            xmlNode = doc.SelectSingleNode("/rdf:RDF/rdf:Description", NamespaceManager);
            xmlNode = xmlNode.Attributes["xap:Rating"];
        }
        
        if (xmlNode != null)
        {
            this.Rating = Convert.ToInt32(xmlNode.InnerText);
        }

        // get keywords
        xmlNode = doc.SelectSingleNode("/rdf:RDF/rdf:Description/dc:subject/rdf:Bag", NamespaceManager);
        
        if (xmlNode != null)
        {
             
            foreach (XmlNode li in xmlNode)
            {
                Keywords.Add(li.InnerText);
            }
        }

        // get description
        xmlNode = doc.SelectSingleNode("/rdf:RDF/rdf:Description/dc:description/rdf:Alt", NamespaceManager);
        
        if (xmlNode != null)
        {
            this.Description = xmlNode.ChildNodes[0].InnerText;
        }

    } 
    catch (Exception ex) 
    { 
        throw new ApplicationException("Error occured while readning meta-data from image. The error was: " + ex.Message); 
    } 
    finally 
    { 
        doc = null; 
    } 
} 

There you have it. I hope this saves someone a few hours when they try and do this.

Posted Tuesday, January 30, 2007    Permalink    Comments [23]  View blog reactions

 

Jello 2.55 rocks da house

Since posting about Jello, the author fixed the issue I mentioned in my feedback in version 2.5. However, the latest release, 2.55 simply rocks. The perf is improved and he added a feature I've always wanted in Outlook... why oh why can't the Outlook todobar support this:

+blog about mozy vs carbonite, @Blog

and create a task called "blog abot mozy vs carbonite" in the @Blog category.

You can see how this looks from the screen shot below:

I also appreciate the feedback to what was just created and the link to the item.

Jello is simply awesome. I spend more time in my Outlook today page now than ever before.

If you use GTD and you use Outlook you need to try this out. It really takes you away from your Inbox which is a good thing!

Posted Tuesday, January 30, 2007    Permalink    Comments [2]  View blog reactions

 

Warning to users who have the Nikon NEF codec installed

If you ran to Nikon's web site (like I did) to download the Nikon NEF codec for Vista and then proceeded to add some keywords or captions to your photos then I hope you have a backup. Those files will not render in Adobe Bridge or PhotoShop any longer. You see when the NEF codec is installed, then Vista proceeds to write any meta data changes using the supplied codec (if one is available). So it appears that Nikon is making changes to the file that Adobe Camera Raw does not understand.

As a test I placed the modified NEF file back on my memory card and the camera rendered it just fine.

I hope Adobe fixes this ASAP.

This also applies if you have edited the photo using the Photo Info tool and have the NEF codec installed on either XP or Vista.

Posted Monday, January 29, 2007    Permalink    Comments [0]  View blog reactions

 

# Sunday, January 28, 2007

My script for converting digicam videos

A while ago I asked how folks convert their digicam videos from AVI files to something smaller. A number of folks suggested ffmpeg. Well it's far to convoluted to even figure out what I needed to install to make it work. Having a command line solution would be nice though so that I could dump any new videos from the camera into a folder and just batch convert them.

Anyway, lucky for me there is a great free solution. It's called the Windows Media Encoder Script which comes with Windows Media Encoder 9 Series.

To convert a folder of movies from AVI to WMV you first need to create a profile. You can do this with the supplied Profile Editor. Here is the one that I am using:

Name: Convert AVI to WMV

Audio: Quality VBR / Windows Media Audio 9.2

Video: Bit rate VBR (Peak) / Windows Media Video 9

Video size: same as video input

Frame rate: 29.97

Video bit rate (average): 1894.976K

Video peak bit rate: 5684.928K

Peak buffer size: 5 seconds

Decoder Complexity: Auto

Once you have your profile saved open the command line and enter:

cscript.exe wmcmd.vbs -loadprofile Canon.prx -input "D:\input" -output "D:\output"

With this script I am seeing 6 - 8 x smaller file sizes. For example a 150 MB video of my cat is now 20 MB. The quality looks the same to me.

There are a lot more details one what you can do in the help file.

Posted Monday, January 29, 2007    Permalink    Comments [0]  View blog reactions

 

Warning to you if you used Microsoft Digital Image Suite and upgrade to Vista

Microsoft Digital ImagingIf you ever used any of the Microsoft Digital Image Suite products to add keywords or captions to your photos and you plan to use Vista you are in for a surprise.

Digital Image Suite writes keywords and captions to proprietary EXIF tags and not the IPTC fields that most software (Picasa, Adobe Applications, iPhoto etc) use. The field in question is EXIF Property Tag ID 40094 which is a Unicode String.

However, Digital Image Suite does read those fields just fine.

So say yo have a photo. Now you've added a bunch of keywords to those photos in the past. But you stopped using Digital Image Suite and started using a different program that writes them to the IPTC fields?

Well now you have a photo with two sets of conflicting keywords. But who cares right? All programs except MS ones ignore the Microsoft EXIF fields for keyword and caption. Well, if you plan to view those photos on Vista you are in trouble.

You see, Microsoft has fixed the sins of the past and Vista has proper support for all things photo. This includes new APIs and extensibility for all kinds of metadata. This includes IPTC/EXIF/XMP as well as a pluggable model for vendors to write codecs for their proprietary image formats (like Nikon has done for NEF).

Well, great you say... but here is the kicker. For compatibility reasons, Windows Photo Gallery still reads the EXIF keywords. This ensures that folks who only used Digital Image Suite will still see their keywords and captions. However, since it shows both the EXIF and IPTC keywords you don't know which one is which. Not to long ago I redid all my keywords in Adobe Bridge and iView... this fixed everything in the IPTC fields but left the EXIF fields untouched. Uh oh, now my keywords are a mess!

Well, luckily there is a way (tedious) to fix this.

  1. if you don't have it, install Digital Image Suite on Windows XP
  2. Load all your pictures and let it go through them all (this can take a while)
  3. Load the Labels view
  4. Delete every single Label

This will result in Digital Image Suite essentially zeroing out the EXIF keywords from your images (and leaving the IPTC ones in tact). Now you can move your photos to Vista and feel good knowing things will work fine from now on.

Mad props to the MS Photo team for finally getting it right on Vista (and in the .NET Framework 3.0).

Posted Monday, January 29, 2007    Permalink    Comments [8]  View blog reactions

 

# Saturday, January 27, 2007

How many updaters do I need?

  1. Windows Update
  2. Microsoft Update
  3. Apple Software Update
  4. Adobe Updater
  5. and the list goes on.

Well I also discovered there is an Install Shield Updater. I hate crap like that. I was wondering how to remove it and I found this.

The latest Nikon NEF Codec for Vista installs this gem without my permission.

You can download this application and evict the updater from your machine. Keep it in your portable apps folder.

Why does this stuff bother me? Cause each of these applications runs all the time doing nothing useful. The frequency with which all these products get updated does not warrant something running all the time.

Posted Saturday, January 27, 2007    Permalink    Comments [3]  View blog reactions

 

Adobe PhotoShop CS 2 Uninstall

It' not often that I am impressed by Adobe's install process. But today I was really impressed. You see Photoshop CS2 requires that you activate it. This prevents you from buying one copy and using it on more computers than the license allows.

The neat thing is that when I went to uninstall PhotoShop it asked me if I wanted to de-activate it first. Now that is smart. It will save me a lot of aggravation when I re-install it later and can't activate it because I forgot to deactivate it.

Other programs that need this kind of feature include iTunes and every other product that requires activation.

Posted Saturday, January 27, 2007    Permalink    Comments [0]  View blog reactions

 

# Thursday, January 25, 2007

I love the lazy web, DST fix for Windows Mobile

Isn't it great when you blog about a problem and some one else does the work to create a solution? This is referred to as the Lazy Web and I love it.

Get your Windows Mobile DST fix here.

Posted Thursday, January 25, 2007    Permalink    Comments [3]  View blog reactions

 

# Wednesday, January 24, 2007

Apple TV vs Media Center + MCE Tunes

I just found out about a Media Center 2005 add-in that will play all iTunes content in the MCE UX. This seems like a better idea than buying an Apple TV just so I can watch my downloaded TV shows in my living room.

MCE Tunes seems perfect. Anyone using it? This could save me $270 :-) (Apple TV = $300, MCE Tunes = $30).

Posted Thursday, January 25, 2007    Permalink    Comments [3]  View blog reactions

 

Note to self, screw on F Connectors suck

After wiring my whole house with structured wiring a I learned a valuable lesson. Don't cheap out on stuff. Why? Cause when you realize that your screw on F Connectors on all your RG6 cable is leaking signal and you now have to retrofit all of them with proper compression F Connectors, it's a BIG PAIN IN THE ASS.

Buy a decent compression tool, stripper and do it right the first time. Stripping a Quad Shield Cable is actually not just a strip and crimp thing... you need to do a little work, pealing back the metal strands and all. Basically, read the instructions that come with the stripper/compressor (which I didn't do).

Bad

 

 

 

 

 

Good

PPC Compression F Connectors CMP6

Posted Wednesday, January 24, 2007    Permalink    Comments [2]  View blog reactions