Server Error in '/' Application.

A generic error occurred in GDI+.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.

Source Error:


Line 173:
Line 174:                If Right(LCase(pathTosave), 3) = "jpg" Or Right(LCase(pathTosave), 3) = "peg" Then
Line 175:                    resized.Save(pathTosave, Imaging.ImageFormat.Jpeg)
Line 176:                ElseIf Right(LCase(pathTosave), 3) = "png" Then
Line 177:                    resized.Save(pathTosave, Imaging.ImageFormat.Png)

Source File: e:\home\izaurbinati\Web\media\custom.aspx.vb    Line: 175

Stack Trace:


[ExternalException (0x80004005): A generic error occurred in GDI+.]
   Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) +202
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) +150
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) +175
   defaultt.Redimensionar(String CaminhoImagem, Int32 MaxLargura, Int32 MaxAltura, String filename) in e:\home\izaurbinati\Web\media\custom.aspx.vb:175
   defaultt.Page_Load(Object sender, EventArgs e) in e:\home\izaurbinati\Web\media\custom.aspx.vb:28
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8975