I no longer work at Microsoft, so please don't bother leaving a comment here or trying to contact me through my MSDN blog.
You can find my new blog at http://www.technologytoolbox.com/blog/jjameson. My new site also provides copies of all posts from my MSDN blog.
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.