I’ve been playing with Picture Libraries, and I began to wonder, where are the thumbnails stored?
Picture ListItems have 3 different sizes…
Thumbnails:
Previews:
And the original image itself:
Looking at the URLs for these image, the thumbnails seem to be under a hidden folder in the Picture Library called _t
, and the previews are under _w
. Looking at the Picture Library in SharePoint Designer, the images themselves seem to be related to each other by filename:
Looking at the file sizes, you can see a massive difference in the file sizes between the original and the thumbnail – 496k vs 5k, or about 1% the size.
Neat, simple. I’m not sure what it is generates the thumbnails, but they’re definitely done at upload, and it seems to make a pretty good job of it.
Of course, image files being stored in a document library don’t have thumbnails, so that won’t work so well if you’re wanting to display thumbnails in something like the Search Results.
Hi Andy
I’ve been working on some Data Views that use the Picture library, but I can’t seem to find a way to show the thumbnails or the preview images. I can only get the full image. Do you perhaps have a workaround for this?
I figured it out. You need to build an XPath query that takes a substring-before() and a substring-after() and then concat() them to look like the URL of the thumbnails. It’s really easy, but it’s taken me all day to figure out.
Hi Peter,
Sorry, I’m away on training at the moment, but yes, what you’ve done is exactly what I’d’ve suggested, if there isn’t a suitable column with the thumbnail in it. It’s worth noting, if there is, it may be hidden.
But otherwise, yes, you can construct the Thumbnail URL.
And here is the XPATH:
Just in case anyone else came here and does not have a day to spare.
thanks guys this info was helpful
ah my html was stripped:
{@FileDirRef}/_t/{concat(substring-before(@FileLeafRef,concat(‘.’,@FileType)),’_’,@FileType,’.’,@FileType)}
just put this in src attribute of img tag
Drasko,
Can you elaborate a littel more on how to add this XPATH?
I have a picture library I’m trying to use as the source for our images. I’ve created another .aspx page, inserted the data view web part and pointed it to the list with my photos.
I’m in the common tasks area for the DVWP, and am trying to add a formula column with the code you’ve included above.
Thanks,
Brian
Drasko,
Thanks for the XPATH, however it required some tweaking for me to work correctly.
Here is what worked for me.
/{@FileDirRef}/_t/{concat(substring-before(@FileLeafRef,’.’),’_’,@FileType,’.’,@FileType)}
I had to add ‘/’ to the start then remove the second concatenation.
Does anybody have any idea why the thumbnails would not be generated during file upload I’m on a windows IIS server.
Are you using an ordinary Picture library? Are your images of a standard type (e.g. PNG, JPEG)?
JFYI – third-party solution for thumbnails preview in SharePoint 2010/2013: http://www.harepoint.com/Products/HarePointThumbnails/Default.aspx
Note it allows to generate preview in SharePoint libraries both for images and files (.doc, .xls, .pdf, etc).