I’ve got a Custom Picture Library definition – it encapsulates much of the same functionality I described a few days ago for Document Libraries. I built it, then ran Solution Generator against it to create the List definition and schema.
It all seemed to work alright, but when I tried uploading an image, it didn’t create my thumbnails, or the _w and _t folders the thumbnails are hidden in! This was a problem.
Well, I cracked open reflector (how did we do .NET development before it?) and dug around. Didn’t find much, except that the Upload.aspx page decides if it is for a Picture Library based on the List Template‘s Type attribute (ordinarily 109).
The Type attribute of a List Template tag says this:
Provides a unique identifier for the template. This identifier must be unique within the feature, but need not be unique across all feature definitions or site definitions.
This attribute corresponds to the Type attribute of the List element
Hmm. Interesting. I had changed my List Template‘s Type – I’ve been keeping all of mine unique in my solution, as I do have multiple lists based on the same out-of-box type (e.g. multiple lists based upon the ‘Custom List’ type). As I was suspicious, I changed this back to 109, and tried again. My thumbnails now worked.
I guess that this mean that the thumbnailing done during the upload process is contingent on the list’s Type being 109 still. As a consequence, I guess that a feature can only have one custom Picture Library definition (as “This identifier must be unique within the feature”).