Out Of Memory exception on System.Drawing.Image.FromFile()

Jak
Jak
Member
404 Points
167 Posts

I'm using File manager to upload images. Getting out of memory exception at:

System.Drawing.Image img = System.Drawing.Image.FromFile(fileInfo.FullName)

Stack trace:

[OutOfMemoryException: Out of memory.]
   System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) +200
   filemanager.getFolderInfo(String path) +2651
   filemanager.ProcessRequest(HttpContext context) +574
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +814
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +132
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73
Views: 62
Total Answered: 1
Total Marked As Answer: 0
Posted On: 15-Jul-2021 00:04

Share:   fb twitter linkedin
Answers
Jak
Jak
Member
404 Points
167 Posts
         

Found issue and fixed by self. There was one image with size more than 2MB causing "Out of memory". Removed, working as charm. 

Posted On: 19-Jul-2021 07:41
 Log In to Chat