thumbnailsopen-packaging-convention

Show thumbnail of an OPC file in Windows Explorer


I have an OPC-file. It works fine. Now I'm trying to add thumbnail, so when this file is shown in Windows Explorer or, for example, as attachment in browser, my thumbnail is displayed.

I tried to add

<Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail" Target="/thumbnail.png" Id="RTN1" />

to .rels file. I tried to add jpeg instead of png. I tried 32x32 and 64x64 sizes.

[Content_Types].xml:

<Default Extension="png" ContentType="image/png" />

or <Default Extension="jpeg" ContentType="image/jpeg" />

Structure of my file:

A markup example of working OPC-file with thumbnail and it's structure will me much appreciated.

EDIT 2:

I've managed to show thumbnail when extension of a file is 'xps'.


Solution

  • There is nothing to do with OPC format. Windows have it's own way to draw icon for each file extension. To have a specific icon drawn for a specific file extension you need to create a dll, which implements IThumbnailProvider interface and register it. More info here.