GDI+ Exception

45 views
Skip to first unread message

asciimo

unread,
Jul 19, 2007, 11:37:49 AM7/19/07
to url2jpeg
First of all, url2jpeg is super-useful. Thanks! And thanks for
opening the source code, too. I'm not a .NET programmer, but I
appreciate the gesture.

I run url2jpeg as part of a scheduled task nightly. Today I found a
windows dialog box complaining about an exception in GDI+, and the
following information:

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

************** Exception Text **************
System.Runtime.InteropServices.ExternalException: A generic error
occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo
encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(String filename, ImageFormat format)
at url2jpeg.script.Run(Boolean bSelection, String destination)
at url2jpeg.Main.Main_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
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.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
url2jpeg
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/URL2JPEG/url2jpeg.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
x1yedr03
Assembly Version: 1.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
8cpswmar
Assembly Version: 1.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
nllfho3o
Assembly Version: 1.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.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.

url2jpeg team

unread,
Jul 19, 2007, 5:36:26 PM7/19/07
to url2jpeg
On Jul 19, 5:37 pm, asciimo <asci...@gmail.com> wrote:
> First of all, url2jpeg is super-useful. Thanks! And thanks for
> opening the source code, too. I'm not a .NET programmer, but I
> appreciate the gesture.
>
> I run url2jpeg as part of a scheduled task nightly. Today I found a
> windows dialog box complaining about an exception in GDI+, and the
> following information:
>
> See the end of this message for details on invoking
> just-in-time (JIT) debugging instead of this dialog box.
>
> ************** Exception Text **************
> System.Runtime.InteropServices.ExternalException: A generic error
> occurred in GDI+.
> at System.Drawing.Image.Save(String filename, ImageCodecInfo
> encoder, EncoderParameters encoderParams)
> at System.Drawing.Image.Save(String filename, ImageFormat format)
> at url2jpeg.script.Run(Boolean bSelection, String destination)
> at url2jpeg.Main.Main_Load(Object sender, EventArgs e)

Hi,
Strange the error occur during the image file is saved.
- Try in another image format (if you can)
- Disk full?
- Security problem

If you can reproduce the problem I can send you a version with debug
info for a better stack trace and trouble shooting.

Sincerely,
url2jpeg Team


asciimo

unread,
Jul 20, 2007, 12:34:04 PM7/20/07
to url2jpeg
Thank you for the response. Yes, it looks like it was filesystem-
related. url2jpeg was writing to a virtual drive connected via
SFTPDrive. Apparently the machine that hosted the actual filesystem
was having SSH problems throughout the day, and it's very likely that
the drive was unwritable at the time this error occurred.

Do you think url2jpeg could catch this exception and provide a more
detailed, user-friendly message? I think url2jpeg should be more
verbose about its errors in general. For example, if you load a
poorly-formed XML file, nothing happens. A message about the bad file
would be useful and could shorten the time a user spends trouble-
shooting problems.

url2jpeg team

unread,
Jul 24, 2007, 12:33:02 PM7/24/07
to url2jpeg

Hi,
There is so many way to make an app crash...
For this case GDI+ did not report the error was filesystem related.
For the XML file the choice is to not warn the user and recreate a new
correct file.
Source code is available and Visual Studio Express is free so you can
handle the error yourself.

Cheer,
url2jpeg Team

Reply all
Reply to author
Forward
0 new messages