.pdn file extension

I work with Paint.net and the native file format there is: .pdn

I was wondering what I would have to do so that I can preview the image files in Opus Viewer. as, as of now, there is no plug-in for this format available in Opus, to my knowledge.

Thank you for any suggestions you can offer. And:
Happy New Year

You'd have to write a viewer plugin, or find or write a Preview Handler (would also work in File Explorer, Office, etc.), or pay/convince someone else to write one.

The Opus side of writing such a plugin is actually trivial for anyone with beginner C/C++ skills. The hard part, if there isn't a library out there which someone has already written for the image format, is writing the code to decipher the image format and turn it into bitmap data.

As far as I know, there isn't a library for this format, although there are one or two third party viewers. IrfanView can view the files, from a quick search, and can be used to convert a .PDN file to a .PNG file. So if the image format is not something anyone can work out on their own, and the code for viewing it is not available, then a plugin could be written which calls IrfanView behind the scenes, converts the image to .PNG format in the temp folder, and then opens & decodes the .PNG file to get the bitmap data. That would be slower than decoding the file directly, of course.

Revisiting .pdn file extension issues:

Using Win 10 File Explorer, I can see both a .pdn "thumbnail" in icon view and the actual image in the viewer. In January 2020, the Paint.net developer confirmed this is as expected do to a shell extension.

In DOpus, I can neither view .pdn thumbnails or see the image in the viewer.

Unless I'm missing something, if we can see it in File Explorer, we should see it in DOpus, correct?

Opus will ask Windows for thumbnails for any format it doesn’t understand itself, so it should work.

@Leo Here are two multiple layer pdn examples, one small (109 KB) and one large (8.79 MB) located in the same folder (Desktop):

  1. small .pdn image in File Manager

As presented, shows both a thumbnail and the image in the viewer.

Same small .pdn image in DOpus:

As presented, a thumbnail but no image

  1. Large .pdn image in File Manager:

As presented, thumbnail and image

Same .pdn image in DOpus:

As presented, no thumbnail or image.

Both work as expected in File Explorer. Only one works, and just with the thumbnail, in DOpus.

Suggestions on resolving this?

The files that aren’t being displayed look like they’re all text characters, so the TextThumbs plugin handles their thumbnails and the Text viewer plugin displays them in the viewer.

The TextThumbs plugin lets you specify a list of extensions that it shouldn’t handle, which should solve that.

The Text viewer plugin doesn’t have a similar list, but try disabling it to see if things work, in case there’s something else wrong as well or instead.

@Leo

This worked.

This worked, as well. Of course, it removes the ability to view text files.

How might one get both to work simultaneously?

@Leo

Without the ability to exclude file types in the Text viewer plugin, it appears users will have to choose between viewing text files and pdn files, correct?

If that is the case, request the GPS team add adjusting the Text viewer plugin to allow file type exclusions to its development list.

1 Like

It's on our list!

1 Like

We'll have a change in the next version that makes both plugins ignore PDN files by default.

1 Like

Hey, any chance this could be extended for comic book files .cbz and .cbr I get the exact same issue with occasional files and same workaround fixes it.

I'm surprised if those get detected as text files. Could you point to some example files which cause problems, or send me a couple via private message?

I don't have any samples I can send but I can see the file its previewing instead of the front cover is the ComicInfo.xml file.

Out of curiosity I unzipped and re-zipped the file and it showed as expected, no more text preview, so must be something odd in the zip process sometiimes (tried a few different zip programs but couldn't replicate the text preview on any). So i've got a work around for the few odd files this happens to, still might be nice if the text viewer plugin had the same exclude option as the textthumb plugin

The text plugin is the last resort (other than non-Opus plugins), and Opus usually shows thumbnails for CBZ files via the Archives plugin.

So it probably wouldn't help, unless you're not using the Archives plugin. The issue is probably with how the archive is structured (e.g. images in subdirs with an xml by itself in the root would probably not work). But I can only guess without an example file.