473,890 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 .ExternalExcept ion: A generic error occurred in GDI+

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

...::CODE::.
System.Drawing. Bitmap outputImage = new System.Drawing. Bitmap(origBitm ap, newWidth, newHeight)
outputImage.Sav e(Server.MapPat h(basePath + System.IO.Path. GetFileName(_Fi leName.Value)), System.Drawing. Imaging.ImageFo rmat.Jpeg)

statusinfo.Inne rHtml = "Uploaded " + Server.MapPath( basePath + System.IO.Path. GetFileName(_Fi leName.Value))

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

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

Regards
Ashish M Bhonkiya

"Tim::.." <an*******@disc ussions.microso ft.com> wrote in message
news:96******** *************** ***********@mic rosoft.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 .ExternalExcept ion: A generic error occurred in GDI+.
The line causing the problem is outputImage.Sav e, but I really don't understand why.
..::CODE::..
System.Drawing. Bitmap outputImage = new System.Drawing. Bitmap(origBitm ap, newWidth, newHeight); outputImage.Sav e(Server.MapPat h(basePath + System.IO.Path. GetFileName(_Fi leName.Value)), System.Drawing. Imaging.ImageFo r
mat.Jpeg);
statusinfo.Inne rHtml = "Uploaded " + Server.MapPath( basePath + System.IO.Path. GetFileName(_Fi leName.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
48254
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+. System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
2
22319
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 below. I am running IIS5 on WinXP Pro. Server Error in '/Chapter04' Application. ---------------------------------------------------------------------------- ---- A generic error occurred in GDI+. Description: An unhandled exception occurred...
0
1204
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, will be an Image Gallery. Now when new images are uploaded, I want the page to automaticly generate Thumbnails. No problem so far, the code I use (see below) first calculates the new with and height (maintaining the aspect ratio) and then...
13
4672
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 open that file in whatever viewer/editor is the default for the users system. I tried to do picturebox1.image.save(filename), which results in "A Generic error occured in GDI+". However, if I use an unbound picturebox, do a
15
5381
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 path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
0
1708
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 code in try catch block, and then the first error displayed is
6
7866
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); .... pnlImageIndex.Controls.Add(pb);
7
10400
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 invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
1
3998
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 exception is thrown.
0
9812
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10799
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10446
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8004
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7154
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6032
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3263
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.