McHildinger Posted July 16, 2019 Share Posted July 16, 2019 (edited) When opening a JPEG file that is intentionally misnamed as a .bmp, as of Paint.net 4.2, it gives this error: "Application version: paint.net 4.2 PaintDotNet.Imaging.UnknownImageFormatException (0x88982F07): D:\src\pdn\src\SystemLayer.Native\Imaging\WICImagingFactory.cpp (892) : hr = spDecoder->Initialize( spStream, static_cast<WICDecodeOptions>(metadataOptions)); at PaintDotNet.Interop.InteropErrorInfo.ThrowIfError() in D:\src\pdn\src\Base\Interop\InteropErrorInfo.cs:line 98 at PaintDotNet.SystemLayer.Native.x64.NativeUtilities.ThrowOnErrorImpl(Int32 hr, SByte* szHr, IUnknown* pFxErrorInfo) at PaintDotNet.SystemLayer.Native.x64.Imaging.WICImagingFactory.CreateDecoderFromStream(Stream stream, BitmapDecodeOptions metadataOptions, Nullable`1 containerFormat, Nullable`1 preferredVendor) at PaintDotNet.Data.WicFileTypeHelpers.Load(Stream input, Nullable`1 forcedContainerFormat, Nullable`1 preferredVendor, MetadataTranscoder metadataTranscoder) in D:\src\pdn\src\PaintDotNet\Data\WicFileTypeHelpers.cs:line 61 at PaintDotNet.Data.BmpFileType.OnLoad(Stream input) in D:\src\pdn\src\PaintDotNet\Data\BmpFileType.cs:line 93 at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src\Data\FileType.cs:line 482 at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src\Base\Functional\Func.cs:line 158" I believe (but not sure) that in previous versions, it would open the file without complaint or (apparent) issue. Edited July 16, 2019 by McHildinger Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 16, 2019 Share Posted July 16, 2019 Whether or not Paint.NET opened this type of misnamed file in the past, changes required for new features causes Paint.NET to no longer open them. The simple solution is to properly name your files before trying to open them. If you need help identifying what the proper extension should be, try this plugin: https://forums.getpaint.net/topic/31715-whats-it-tools-effect-plugin/ I would not expect Rick to "fix" this problem. EDIT: I was wrong... Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 16, 2019 Share Posted July 16, 2019 If it's a bmp then it should have the .bmp extension ... not .jpg This was essentially a bug in older versions, an accidental features due to the way GDI+ was gracious about things. The file type system in PDN isn't set up to identify files and parse them regardless of the extension. However, my intention with 4.2 was to preserve this behavior, even if I didn't really like it. GDI+ is a wrapper around WIC, but now PDN is using WIC directly, and WIC does support this behavior. When you* open an image with WIC you can tell it to force a specific container format (e.g. BMP, PNG, ...) or you can say "just figure it out". And it looks like I missed a spot and PDN's BmpFileType is say "only use BMP" instead of "just figure it out". I'll fix this for 4.2.1, it's easy. * as in "the developer writing the code" 1 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 16, 2019 Share Posted July 16, 2019 However, worth noting, is that if you have an image with the wrong file extension, the metadata will not be parsed correctly. I can't guarantee that things will work. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
macneacail Posted July 16, 2019 Share Posted July 16, 2019 Dear Rick: The problem belongs with the people at Microsoft who let bmp mask for png -- this is just a simple decision -- but one that has impacts years later. Paint.net is a good program. John Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 16, 2019 Share Posted July 16, 2019 I wouldn't "blame" Microsoft. They implemented it this way intentionally. In code, when you open an image with WIC you give it a "stream," not a file name. It doesn't even know the file extension of what you're working with. It must be able to detect the image type, usually from the first few bytes, and route the request to the given decoder. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 31, 2019 Share Posted July 31, 2019 The beta should fix this: https://forums.getpaint.net/topic/114817-paintnet-421-beta-build-7151/ Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.