njcrawford / EmbroideryReader

Open source .PES file viewer
GNU General Public License v2.0
41 stars 20 forks source link

System.ArgumentException: Parameter is not valid. #5

Closed cgrossde closed 8 years ago

cgrossde commented 8 years ago

This nice program worked flawlessly for a few weeks on my moms computer(Win 7 x64) but suddenly it throws an error on startup (e.g. double clicking a file to open it). I can click continue on the error dialog and then manually use 'File > open' to view a file but that's not so convenient anymore.

Here's the error, maybe you know what to do with this:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: Parameter is not valid.
  at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
  at embroideryReader.frmMain.updateDesignImage()
  at embroideryReader.frmMain.openFile(String filename)
  at embroideryReader.frmMain.Form1_Load(Object sender, EventArgs e)
  at System.Windows.Forms.Form.OnLoad(EventArgs e)
  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  at System.Windows.Forms.Control.CreateControl()
  at System.Windows.Forms.Control.WmShowWindow(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.Form.WndProc(Message& m)
  at embroideryReader.frmMain.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
embroideryReader
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.0.0
   CodeBase: file:///C:/Program%20Files%20(x86)/NJCrawford%20Software/Embroidery%20Reader/embroideryReader.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34251 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34270 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
IniFile
   Assembly Version: 2.2.0.0
   Win32 Version: 2.2.0.0
   CodeBase: file:///C:/Program%20Files%20(x86)/NJCrawford%20Software/Embroidery%20Reader/IniFile.DLL
----------------------------------------
System.Configuration
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
PesFile
   Assembly Version: 1.2.0.0
   Win32 Version: 1.2.0.0
   CodeBase: file:///C:/Program%20Files%20(x86)/NJCrawford%20Software/Embroidery%20Reader/PesFile.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
njcrawford commented 8 years ago

Hi Chris, Thank you for opening an issue for this! After looking into it, there appear to be some cases where the image scaling code calculates a negative size for the output bitmap. I'll try to get an update out in the next week or so to fix this issue.

cgrossde commented 8 years ago

Thanks! If you want me to test it, just supply me with a release.

njcrawford commented 8 years ago

Hi Chris, Could you test this beta release and let me know if it fixes the problem you're seeing? https://github.com/njcrawford/EmbroideryReader/releases/tag/v2.0.1-beta

cgrossde commented 8 years ago

After installing the new release and opening the first file I saw this. bildschirmfoto 2016-01-08 um 16 01 09

After expanding the window it looks like this: bildschirmfoto 2016-01-08 um 16 01 01

Seems to be some translation problem?

njcrawford commented 8 years ago

I did see the missing translation problem a couple of times while I was testing. I don't think it's related to the crashing, so I've opened issue #6 to track that one.

I'll look into the tiny window problem... I'm guessing a bad window size value was saved in the settings file, and that's probably what caused the earlier crashes.

cgrossde commented 8 years ago

I think you are right with the tiny window problem. I remember having a tiny window before.

njcrawford commented 8 years ago

I released a new version a couple days ago, but forgot to update this issue. Can you test with version 2.0.2 and see if it fixes the problem? (link to download page for convenience: http://www.njcrawford.com/programs/embroidery-reader/ )

njcrawford commented 8 years ago

Hi Chris, Is this still an issue for you? If so, could you try it with version 2.1.0 and see if it still occurs?

cgrossde commented 8 years ago

No, I think this is solved. Thanks :+1: