Jump to content

.pdn thumbnail shows drop shadow


Recommended Posts

I'm wondering why the thumbnail of a .pdn file shows a drop shadow in FileExplorer icon views (or the preview panel).

Typically just .bmps are showing the drop shadow and no other file types (on my Windows 10 laptop).

Any idea/hint why this is the case for .pdn files? I would like to get it for .bmrl.

I can not imagine that the drop shadow is part of the thumbnail. Because it uses exact the same colors as .bmps in dark and light mode.

Does it depend on the type of registration?

 

midora%20signature.gif
Link to comment
Share on other sites

The files with extension .bmp and .bmrl are using my new shell extension to create the thumbnails.

The 'DropShadow bmrl.bmp' file ist just a renamed copy of the 'DropShadow.bmrl' which I saved from paint.net with the bmrl filetype plugin.

This 'DropShadow bmrl.bmp' is just to show that thumbnails for files with .bmp extension but .bmrl content are showing now a thumbnail. This is not the case without the shell extension for .bmp because Windos detects these .bmp not as bitmap files.

 

412463290_DropShadowThumbnails.png.8e68a004684a8ebf29224d98e320dcc3.png

Same effect in Windows light mode.

So the question is, how does Windows know that .pdn should get a drop shadow but not .bmrl (latest Windows 10).

 

midora%20signature.gif
Link to comment
Share on other sites

I'm not sure why it happens, I've seen it though. Could be the shell interface you're implementing, which had better be IThumbnailProvider and not whatever the ye ol' deprecated interface is from the 2K/XP days. Could be you're doing something wrong with the bitmap itself, like returning it in the wrong pixel format. I don't know. Good documentation and examples are hard to come by for this stuff.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

We know the documentation of these COM interfaces is limited. .NET 4.0 is needed to implement the interfaces in c#.

I didn't expect that a lot of people are experienced with this. But you never know.

 

The handler uses COM IThumbnailProvider and returns BGRA (or you couldn't see through 😉

No idea what's going on there. Just the standard image format thumbnails are showing the shadow AND .pdn.

It's for sure not important but I really like to understand what's going on.

In the moment the code for .bmrl draws the image a little bit higher into the bitmap just to reduce the missing shadow offset effect.

This way the top line of the images in all the thumbnails is adjusted (otherwise the .bmrl thumbnails would sit a bit deeper).

This seems to work for all thumbnail sizes.

 

In the moment I'm creating a InfoTipHandler to show some properties of .bmrl files.

 

Maybe paint.net could add one to show the dimensions of the image.

 

midora%20signature.gif
Link to comment
Share on other sites

Maybe the issue is related to this comment:

 

An implementation of this interface for photo thumbnails is supplied in Microsoft Windows as CLSID_PhotoThumbnailProvider. Applications that use the supplied implementation must define a constant CLSID identifier using the GUID {C7657C4A-9F68-40fa-A4DF-96BC08EB3551}.

 

 

midora%20signature.gif
Link to comment
Share on other sites

CLSID_PhotoThumbnailProvider handles built-in extensions like JPG and PNG. I use it in the Paint.NET shell extension so that Explorer can handle a few formats, like in case Paint.NET is registered to handle them (like when double-clicking on them) -- no need to use managed code for dealing with them, Explorer can already do it.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

But this really sounds that if paint.net extends .bmp, ... with .pdn and all are getting the shadow then anything which uses CLSID_PhotoThumbnailProvider may be handled similar. Just have to understand how to do it for a try.

midora%20signature.gif
Link to comment
Share on other sites

15 minutes ago, midora said:

Just have to understand how to do it for a try.

 

According to MSDN the drop shadow is provided by the OS, see https://docs.microsoft.com/en-us/windows/win32/shell/thumbnail-providers#thumbnail-adornments.

  • Like 1
  • Upvote 2

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Thanks for the effort @null54. I just found the topic about the Treatment. Then I looked for Treatment in the registry and found

HKEY_CLASSES_ROOT\SystemFileAssociations\image
    Key: Treatment Value: 2  (means Photo Border)

Then I checked the .pdn entry and found

    Key: PerceivedType Value: image

And that's it. Setting this key to .bmrl shows the drop shadow after a restart of the FileExplorer.

That's what I expected in the beginning: There must be a kind of file category marker.

Now I have to figure out how do do this using the sharpshell library. Maybe I have to patch it...

 

midora%20signature.gif
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...