We’ve got a customer doing a very common thing – and to my surprise, the user experience in SharePoint is pretty frustrating.
The customer has a number of publishing pages, with Images at full size and thumbnail size (for roll-up). So far, so standard. What they’d like, though, is the automatic thumbnailing of images when they’re uploaded to SharePoint. “Easy” I thought. Wrong!
First port of call was the Pictures Library. I know from before that it does thumbnailing, and it stores the thumbnails in hidden _t or _w folders. However, there’s the problem – the _t and _w folders are hidden – that’s the point of the _! So, users trying to pick an image from the Picture Library only get to pick the full size image – even though they can see the thumbnail sized one when they’re picking it!
Next I though I’d look at the publishing ‘Site Images’ library. This isn’t a Pictures library, and though it does show a thumbnail, it doesn’t use hidden folders. So, how does it work? I went and looked at it, and it seems to get the thumbnail from a file in the _Layouts directory called AssetUploader.aspx.
Okay, so what is in that file?
Nice. It just inherits from Microsoft.SharePoint.Publishing.Internal.Codebehind.AssetThumbnailerPage. And if you look it up on MSDN – it’s undocumented. Googling finds little about it – this was the best I saw. And it is obfuscated – so Reflector doesn’t show what’s going on.
However, we can see into Microsoft.SharePoint.Publishing.Internal.Codebehind.AssetThumbnailer!
Nice. No sign of any caching or anything there. Certainly, there is a browser cache – but are we regenerating our thumbnail in the image library each time? Honestly, I’m not sure.
So, I don’t think that I fancy doing that. Too many unknowns, and apparently regenerating thumbnails each time they’re requested doesn’t seem very efficient.
What other options are there? Well, an event handler on the list springs to mind – fire when a new image is uploaded, generate a thumbnail, and put it into a picture library. But that’s custom code, which seems a shame.
Edit: I should apologise, seeing as how this post is getting lots of traffic – I’m sorry that I don’t have a pre-built solution. I just thought that people might be interested in how the thumbnails in standard MOSS work, and why I don’t see them as usable for the publishing pages I’m using. Writing an event handler wouldn’t be too hard.