Jump to content

Feature suggestion: Content-based format detection


Recommended Posts

While file extensions provide a quick and cheap way to identify the format of a file, it can sometimes be deceiving, such as in cases where the user has mistakenly given a file the wrong extension. As Paint.NET must read files anyway to open them, it seems logical to me to, instead of reading the extensions in the path of the file, to enumerate each FileType, reading a new method which would read the file's signature and return an enumeration dictating how likely it is that it is the correct FileType to read it the most extensively.

This would provide the following benefits:

  • [*:1ju81x8w]If a user renames a file by accident or mistakenly gives it an extension when saving Paint.NET could still read it.
    [*:1ju81x8w]If a new format was released that was simply the same format given a new extension, a new FileType wouldn't be needed to read it.
    [*:1ju81x8w]There would be no problem with two FileTypes wanting the same extension.
    [*:1ju81x8w]FileTypes could read extensions of old formats already handled by Paint.NET that use the same extension (e.g. APNG).

If this feature causes problems with performance and the UI of open dialogs, then an alternative could be to simply use it as a tie-break and for unknown extensions.

Just my 20p. ;)

KaHuc.png
Link to comment
Share on other sites

While file extensions provide a quick and cheap way to identify the format of a file, it can sometimes be deceiving, such as in cases where the user has mistakenly given a file the wrong extension. As Paint.NET must read files anyway to open them, it seems logical to me to, instead of reading the extensions in the path of the file, to enumerate each FileType, reading a new method which would read the file's signature and return an enumeration dictating how likely it is that it is the correct FileType to read it the most extensively.

This would provide the following benefits:

  • [*:1ju81x8w]If a user renames a file by accident or mistakenly gives it an extension when saving Paint.NET could still read it.
    [*:1ju81x8w]If a new format was released that was simply the same format given a new extension, a new FileType wouldn't be needed to read it.
    [*:1ju81x8w]There would be no problem with two FileTypes wanting the same extension.
    [*:1ju81x8w]FileTypes could read extensions of old formats already handled by Paint.NET that use the same extension (e.g. APNG).

If this feature causes problems with performance and the UI of open dialogs, then an alternative could be to simply use it as a tie-break and for unknown extensions.

Just my 20p. ;)

KaHuc.png
Link to comment
Share on other sites

While file extensions provide a quick and cheap way to identify the format of a file, it can sometimes be deceiving, such as in cases where the user has mistakenly given a file the wrong extension. As Paint.NET must read files anyway to open them, it seems logical to me to, instead of reading the extensions in the path of the file, to enumerate each FileType, reading a new method which would read the file's signature and return an enumeration dictating how likely it is that it is the correct FileType to read it the most extensively.

This would provide the following benefits:

  • [*:1ju81x8w]If a user renames a file by accident or mistakenly gives it an extension when saving Paint.NET could still read it.
    [*:1ju81x8w]If a new format was released that was simply the same format given a new extension, a new FileType wouldn't be needed to read it.
    [*:1ju81x8w]There would be no problem with two FileTypes wanting the same extension.
    [*:1ju81x8w]FileTypes could read extensions of old formats already handled by Paint.NET that use the same extension (e.g. APNG).

If this feature causes problems with performance and the UI of open dialogs, then an alternative could be to simply use it as a tie-break and for unknown extensions.

Just my 20p. ;)

KaHuc.png
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.

×
×
  • Create New...