Jump to content

macneacail

Newbies
  • Posts

    8
  • Joined

  • Last visited

Posts posted by macneacail

  1. 4 hours ago, Rick Brewster said:

     

    Maybe read about it? A ton has changed under the hood. https://blog.getpaint.net/2019/07/13/paint-net-4-2-is-now-available/

     

    And @toe_head2001 is right. The bug is in your code and file naming, not in Paint.NET.

    Dear Rick:

     

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    using (var inFile = File.OpenRead(NameofBitMap))
                {
                    var decoder = BitmapDecoder.Create(inFile, BitmapCreateOptions.None, BitmapCacheOption.None);
                    var encoder = new PngBitmapEncoder();

                    var frame = decoder.Frames[0];
                    encoder.Frames.Add(frame);

                    using (var outFile = File.OpenWrite(NameofBitMap + ".png"))
                    {
                        encoder.Save(outFile);
                    }
                }

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    René Slijkhuis provides a simple workaround for the moment -- 

    I prefer to think of bugs as unused features

    I read the blog content -- interesting 

    Perhaps instead of breaking BMP images created using GDI that is still legal with the perversion that bmp is really PNG in some cases - maintaining the option or putting up a more descriptive error might have been useful. Renaming BMP to PNG worked. 

    But rule number 101 from Computer Science 100 in 1978 - do not criticize other people's code, I always find is useful, although often ignored. 

    As the great Jerry Pournelle once said "bend the punch cards - enjoy the day"

    RIP JP you are missed. 

    Great program by the way. 

     

    John

  2. Thank you for the response. 

     

    Each file is about 5 MB so it will not upload. 

     

    Bitmap newBmp = new Bitmap(XL, Y, System.Drawing.Imaging.PixelFormat.Format24bppRgb);

     

    creates the file 

     

    I wonder why does paint.net 4.1.6 open the files and paint.net has done so since I started using it in about 2012 

    John

  3. Paint.net 4.2 will not open bmp files created using Microsoft Drawing Routines.  paint.NET has been opening these files since 2012

    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

×
×
  • Create New...