locked
TFS HTMLFieldControl fails loading some images, cannot display embedded image in web RRS feed

  • Question

  • I have found that adding images to an Html control will fail in some cases. One sample Image is below. We are using System.Description and the standard HtmlFieldControl to present the information. We have tried this several ways.

    • When one tries to add the image from the web, the image simply does not load, no error is given. The "Insert Image" popup simply eats any error or response. Nothing happens.
    • When we convert it to a 64 bit embedded file (from Outlook 2010 which shows this without a problem), we get a red X and it is undisplayed in any tool.
    • When we add it from visual studio, every thing is fine. It can in fact also be viewed from the web if added in from VS (we are using 2012 update 2)

    We tracked this down to a "size" limit that seems to be inherent in the system.

    1. Max width is 8.43" (809px) before it cannot be displayed
    2. Max length is 13.2" (1267px) before it cannot be displayed

    I note that VS is resizing the graphic when it inserts, most likely why it works and then displays elsewhere.

    Does Microsoft have guidelines on this? Sample re-size code? Is this expected behavior? The goal here is to allow users to email merge into a PBI and we want to keep that Outlook layout as natural as when it was sent in, which is why just making them attachments (done already) is not the ideal solution.


    MP

    Tuesday, July 9, 2013 11:02 PM

All replies

  • Hi,

    Thank you for your post.

    I test the issue in my side with TFS 2012, but cannot reproduce it. Would you please let us know the detail version of your TFS?

    What's the version of your OS?

    Regards,


    Lily Wu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 10, 2013 6:33 AM
    Moderator
  •  Would you please let us know the detail version of your TFS?

    What's the version of your OS?


    TFS Server Software = Version 11.0.60315.1
    TFS Server = Windows Server 2008 RS Enterprise

    TFS Application servers = Windows Serer 2008 R2 Standard dedicated servers

    Client Software = VS 2012 Update 2
    Client = Windows 7, IE 9.0.17, Outlook 2010

    The image I used was 5.88" high by 8.88" wide


    MP

    Wednesday, July 10, 2013 3:42 PM
  • WORKAROUND FOR EMBEDDED EMAILS PROTOTYPED:
    By converting the embedded picture to a System.Drawing.Image, scaling it down, and changing the <img /> tag's length and width properties, I can force this to work.

    if (imageString.Height > 1250 || imageString.Width > 800) { imageString = ScaleImage(imageString, (int)(imageString.Height / 2), (int)(imageString.Width / 2)); Log(TraceEventType.Information, "Scaled the image down using ratio: 1//2"); //hack test to see if we can scale one test image String hack = mm.Value; hack = hack.Replace("852", "426"); //our test image size for width hack = hack.Replace("564", "282"); //our test image size for height description = description.Replace(mm.Value, hack); }

    NOTE: mm.Value is a regular expression result that contains the captured element we want to work with.
    For Example: <img width="220" height="220" id="Picture_x0020_1" src="cid:image002.jpg@01CE7714.AC573250">


    I cannot do anything about the WEB popup control. That remains an issue with wide or long images.


    MP


    • Edited by MPrutz Wednesday, July 10, 2013 11:32 PM Clarification
    Wednesday, July 10, 2013 9:39 PM
  • Hi,

    Thank you for your post.

    I am trying to involve someone to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.

    Regards,


    Lily Wu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, July 11, 2013 7:23 AM
    Moderator