none
How does Outlook embed inline images? RRS feed

  • Question

  • Specifically, I need to know the format of the "\3MailStream" stream created by Outlook when adding inline images. The stream in question is 12 bytes long and seems to consist of 3 32-bit fields:

    aa aa aa aa bb bb bb bb cc cc cc cc

    The first of these fields always seems to contain the value 01 00 00 00, although I have no idea what it means.
    By analysing a number of Outlook-generated emails, I came to the conclusion that the next two fields contain the x and y image dimensions respectively in HIMETRIC units. To generate these values, I applied a constant scaling factor to the pixel dimensions which yields values similar to those generated by Outlook. Although this appears to work ok, it would be useful if someone could provide the following information:

    1. The significance of the first 32-bit field in the stream.
    2. Confirmation that the second and third fields do indeed contain HIMETRIC dimensions.
    3. Advice on the best way to calculate HIMETRIC units. Due to time constraints I wasn't able to investigate this fully, but since a HIMETRIC unit is 0.01mm and a pixel is a display-dependent quantity, I'm not sure that there can ever be a perfect conversion, as you don't know what kind of display device an email is ultimately going to be rendered on.

    Thanks in advance for any help offered,

    Rob

     

    Tuesday, April 27, 2010 2:41 PM

Answers

  • Rob,

     

    The first DWORD is indeed the aspect, which can be one of the two following values:

     

    1.       DVASPECT_ICON=1

    2.       DVASPECT_CONTENT=4

     

    The second DWORD is the x and y dimensions in HIMETRIC format.

     

    HIMETRIC is .01mm units (refer to: http://msdn.microsoft.com/en-us/library/dd162980(VS.85).aspx). A pixel will be different sizes on different devices. You will need to rely on the driver (display or printer) to tell you the DPI (dots per inch) of the device. Once you know the DPI, you can convert from dots (or pixels) to any unit with simple math.

     

    There exist two Win32 API Functions: DPtoLP and LPtoDP that convert from device units (DP) to logical units (LP) and vice versa. Where, in this case, LP could be .01mm units.

     

    Dominic Salemno

    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

     

    Friday, May 21, 2010 6:14 PM

All replies

  • Rob,

    One of our engineers will be following-up with you shortly in regards to this issue.


    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team
    Tuesday, April 27, 2010 7:42 PM
  • Rob,

    I am currently researching your questions and will follow-up with you as things progress.


    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

    Thursday, April 29, 2010 5:30 PM
  • Rob,

    I have no new information to report at the time as I am still researching your questions.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

    Friday, April 30, 2010 7:21 PM
  • Rob,

    I am still researching your inquiry and have nothing new to report at this time.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

    Friday, May 7, 2010 9:09 AM
  • Rob,

    I have no new information to report at this time as I am still researching your questions.

    Dominic Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

    Monday, May 10, 2010 5:15 PM
  • Dominic

    Thank you for the update.  It's still an issue for us so please keep looking!

    Rob.

     

    Tuesday, May 11, 2010 8:16 AM
  • Rob,

    I am still investigating this and will follow-up with you shortly in regards to this issue.

    Dominic Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

    Thursday, May 13, 2010 5:33 PM
  • Rob,

    I currently do not have any more information at this time.

    Dominic Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

     

    Thursday, May 20, 2010 1:58 PM
  • Rob,

     

    The first DWORD is indeed the aspect, which can be one of the two following values:

     

    1.       DVASPECT_ICON=1

    2.       DVASPECT_CONTENT=4

     

    The second DWORD is the x and y dimensions in HIMETRIC format.

     

    HIMETRIC is .01mm units (refer to: http://msdn.microsoft.com/en-us/library/dd162980(VS.85).aspx). A pixel will be different sizes on different devices. You will need to rely on the driver (display or printer) to tell you the DPI (dots per inch) of the device. Once you know the DPI, you can convert from dots (or pixels) to any unit with simple math.

     

    There exist two Win32 API Functions: DPtoLP and LPtoDP that convert from device units (DP) to logical units (LP) and vice versa. Where, in this case, LP could be .01mm units.

     

    Dominic Salemno

    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team

     

    Friday, May 21, 2010 6:14 PM
  • Hi Dominic

    That answers my question, thank you for your persistence!

    Rob

     

    Tuesday, May 25, 2010 4:15 PM