Technology Toolbox

Your technology Sherpa for the Microsoft platform

Jeremy Jameson - Founder and Principal

Search

Search

Missing thumbnail images in SharePoint?...You probably forgot to specify the "ContentType" property

Note

During the process of creating my previous post, I discovered the thumbnail images were not rendering as expected for the custom images that I added to the out-of-the-box SharePoint /PublishingImages picture library (via a feature).

Here is the content of my original Elements.xml file (used to add the images to the library):

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module
    Name="HomeSiteImages"
    Url="PublishingImages"
    Path="HomeSiteConfiguration\PublishingImages">
    <File Url="boat.jpg" Type="GhostableInLibrary"/>
    <File Url="fame.jpg" Type="GhostableInLibrary"/>
    <File Url="ropes.jpg" Type="GhostableInLibrary"/>
  </Module>
</Elements>

To get the thumbnails to render as expected, I simply modified the Elements.xml file as follows:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module
    Name="HomeSiteImages"
    Url="PublishingImages"
    Path="HomeSiteConfiguration\PublishingImages">
    <File Url="boat.jpg" Type="GhostableInLibrary">
      <Property Name="ContentType"
        Value="$Resources:cmscore,contenttype_image_name;" />
    </File>
    <File Url="fame.jpg" Type="GhostableInLibrary">
      <Property Name="ContentType"
        Value="$Resources:cmscore,contenttype_image_name;" />
    </File>
    <File Url="ropes.jpg" Type="GhostableInLibrary">
      <Property Name="ContentType"
        Value="$Resources:cmscore,contenttype_image_name;" />
    </File>
  </Module>
</Elements>

By simply adding the ContentType property (and setting it to "Image"), SharePoint automatically creates the corresponding thumbnail for each image when adding the item to the picture library.

Comments

  1. # re: Missing thumbnail images in SharePoint?...You probably forgot to specify the "ContentType" property

    August 8, 2011 1:43 AM
    Zackary

    I thumbnails that are missing from the Organization Chart under the user profiles through HTTPS, and silver-light doesn't render the thumbnails.

    Any ideas?

  2. # re: Missing thumbnail images in SharePoint?...You probably forgot to specify the "ContentType" property

    October 8, 2012 2:07 AM
    Arvind
    Gravatar
    Thanks for resolving my issue. I have one concern, my original image does not seems to exists but icons are created.
    Any ideas?

Add Comment

Optional, but recommended (especially if you have a Gravatar). Note that your email address will not appear with your comment.
If URL is specified, it will be included as a link with your name.

To prevent spam from being submitted, please select the following fruit: Cherries

Watermelon
Grapes
Pear
Strawberry
Cherries
Apple
 
Please add 2 and 5 and type the answer here: