473,394 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Error Saving Images: A generic error occurred in GDI+.

Hi can someone please tell me why I keep getting the following error and how I might fix it

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

The line causing the problem is outputImage.Save, but I really don't understand why

...::CODE::.
System.Drawing.Bitmap outputImage = new System.Drawing.Bitmap(origBitmap, newWidth, newHeight)
outputImage.Save(Server.MapPath(basePath + System.IO.Path.GetFileName(_FileName.Value)),Syste m.Drawing.Imaging.ImageFormat.Jpeg)

statusinfo.InnerHtml = "Uploaded " + Server.MapPath(basePath + System.IO.Path.GetFileName(_FileName.Value))

Thanks for any help!
Nov 18 '05 #1
2 4866
Hi Tim,

Check out if this help's you to solve your problem
http://aspalliance.com/319

Regards
Ashish M Bhonkiya

"Tim::.." <an*******@discussions.microsoft.com> wrote in message
news:96**********************************@microsof t.com...
Hi can someone please tell me why I keep getting the following error and how I might fix it!
..::ERROR::..
Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
The line causing the problem is outputImage.Save, but I really don't understand why.
..::CODE::..
System.Drawing.Bitmap outputImage = new System.Drawing.Bitmap(origBitmap, newWidth, newHeight); outputImage.Save(Server.MapPath(basePath + System.IO.Path.GetFileName(_FileName.Value)),Syste m.Drawing.Imaging.ImageFor
mat.Jpeg);
statusinfo.InnerHtml = "Uploaded " + Server.MapPath(basePath + System.IO.Path.GetFileName(_FileName.Value));

Thanks for any help!

Nov 18 '05 #2
It's strange because it works fine if I point it at a folder in the root directory of the iis server ie: c:/inetpub/wwwroot/image

but as soon as I add a level to the structure the code gets the same message as mentioned above

Any ideas??

Thanks
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Kennedy [UB] | last post by:
Hi Everyone, I have this multithreaded C# windows forms application which does a lot of image processing. Occasionally, I get the following error: A generic error occurred in GDI+....
2
by: Alphonse Giambrone | last post by:
I am currently reading 'Programming The Web with Visual Basic .NET' and have so far found it to be excellent. Downloaded all the code from Apress and working in chapter 4, I get the error shown...
0
by: Eduard | last post by:
Hey folks, I'm creating an image gallery Custom Web Control. The idea is, that i point to a folder using the web.config, which makes that folder the 'Image Gallery Folder' Each subfolder created,...
13
by: lgbjr | last post by:
Hello All, I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If the user wishes to open or edit an image, I need to save the image in the picturebox to a temp file, then...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
0
by: amit | last post by:
I am getting following error when I click ok. I have got this error while writting images in windows application.I am using visual studio 2005 I tried to get the exact error by putting my...
6
by: Cruithne3753 | last post by:
I'm trying to create a Windows app with a clickable index of images within a local folder. Within a loop I've got:- PictureBox pb = new PictureBox(); pb.Image = Image.FromFile(file); .......
7
by: j4richard | last post by:
Help please, I am getting this "Unhandled Exception has occurred in your application" " A Generic error occurred in GDI+" See the end of this message for details on...
1
by: Jeff | last post by:
hi asp.net 2.0 I'm experimenting with GDI+ in asp.net and get an "A generic error occurred in GDI+." exception. Below is my code, I've marked a line with "<<<<-- here". It's here the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.