Saving image fails with "A generic error occurred in GDI+." and an error code of -2147467259 for large images only

I have run into a stumbling block with my latest application. I am using web services and WSE 3.0 to upload large images (tiffs and jpegs) to a central server. The image data successfully gets to the server via the web services as a byte[] but I am not able to save large images to disk for some reason. If the image is greater than ~5MB I always receive the following error message. "A generic error occurred in GDI+". The error code is -2147467259. This happens on the image.Save method. Since I can save smaller images to disk I do not think that this is a permissions problem. My code follows. imageFile.Contents is a byte array that contains the image content as received via the web service and WSE 3.0.

using (System.IO.MemoryStream memStream = new System.IO.MemoryStream(imageFile.Contents))
{
using (System.Drawing.Image image = System.Drawing.Image.FromStream(memStream, true, false))
{
image.Save(agsTempPath + agsTempName);
}
}

Any ideas what might be happening? 

0
rewt
10/14/2006 3:37:43 PM
asp.net.drawinggdi 1803 articles. 0 followers. Follow

1 Replies
1827 Views

Similar Articles

[PageSpeed] 44

I’ve solved the image
saving issue. Turns out I hadn’t configured the client to use WSE (Web Services
Enhancements) 3.0 and MTOM (Message Transmission Optimization Mechanism). These
technologies provide mechanisms to better support uploading of large files via
web services among many other things such as web services security. Once configured
properly the image was uploaded and saved to disk without any problems. Probably
the byte[] that was being sent (or received) was either incomplete, altered or
otherwise corrupt due to size restrictions.
0
rewt
10/14/2006 4:02:04 PM
Reply:

Similar Artilces:

help resizing an uploaded image and saving it. Getting "a generic GDI error occured" message
I have an app which uploads a picture, sizes it and stores it in the session while it is being displayed and until the user decides to keep it or not.   then it calls another sunction to save the picture that is kept in the session variable but at that point I get an error on my live version. the error is" A generic GDI error occured" That error only occurs on my live version, meaning that on my development version in visual studio the error does not happen. also the eror seem to happen only with cetain file, and not necessarely the big ones. Why is this happening? below...

Error in saving Image-A generic error occurred in GDI+.
hi all, Im saving a barcode in server.mappath.But its giving an error as A generic error occurred in GDI+. Im trying to save it as Bmp format. Can anyone say why this error has come?            Dim imgBarcode As System.Drawing.Image = bcp.GetBarcodeImage(dpi, targetArea)            Dim ms2 As MemoryStream = New MemoryStream            imgBarcode.Save(ms2, System.Drawing.Imaging.ImageFormat.Bmp)      &n...

write permissions error on Win2K "A generic error occurred in GDI+"
Hi All: I have a form that uploads an image ("upImage") to a folder on a server running Win2K.I'm getting the "A generic error occurred in GDI+." error when I try:                 upImage.SaveAs(Request.PhysicalApplicationPath & "images\swatches\" & imagePath & "\" & F.Name)I'm pretty sure this is a permissions error on the directory, because the path is fine (and the code works on a development Win2003 server). Both the ASP.NET and NETWORK users have write permissions on every directory in the chain. What ...

SQL statement failed: (-305) I/O error Fatal error: A disk read from file "SomeDatabase.db" failed with error code: (38)
SQL Anywhere 10.0.1.3831 E. 2009-09-11 21:55:41. SQL statement failed: (-305) I/O error Fatal error: A disk read from file "D:\FHMSL\iFHMS\Data\Feedlot111.db" failed with error code: (38) -- transaction rolled back E. 2009-09-11 21:55:41. Error while executing hook procedure sp_hook_dbmlsync_end. Received this error while running a proc during sync. Tried to validate the db in Sybase Central resulting in the same error. I saw the post at http://groups.google.com/group/sybase.public.sqlanywhere.general/browse_thread/thread/b5d958904160e576?fwc=1 and am wondering if th...

"Error Group: WINSOCK" "Error Code:11004"
Hi Just setup iPrint on the server and tried to install the printer to the laptop and got the following message: Error code:11004 Error message: Winsock 11004 - The DNS name has been found in the database, but its associated data is not correct. Error group: WINSOCK Error code:11004 Anyone know what associated data it is referring to? Thanks in advance -- iangh2 A quick Google found this on http://www.sockets.com/err_lst1.htm WSANO_DATA (11004) Valid name, no data record of requested type Berkeley description: The requested name is valid, but does not hav...

Help on Error message: "An error occurred while try to load the string resources (GetModuleHandle failed with error "
Hi I have compiled my project in VS.NET (ASP.NET web application in C#) without any build errors. This was in the process of establishing a local setup using the files from the deployed server. Now after copying all the relevant files and compiling them, when I try to browse from IIS (inetmgr) with an appropriate start page (Login.aspx), I get the following error message: An error occurred while try to load the string resources (GetModuleHandle failed with error -2147023888). Description: An unhandled exception occurred during the execution of the current web request. Please revie...

Frequent "Failed Error Code: 0x0000190C" errors
I see this frequently with the PCs here. Here is the admin message (converted to plain text): The following deployment events have occurred. For more information log in to the Novell ZENworks Patch Management. ---------------------------------------------------------------------------- ---- Deployment Information Deployment Type: Package Package Name: Discover Applicable Updates Status: Failed Error Code: 0x0000190C : PostScript1 Origin: System Scheduled For: Sep 1 2001 12:00AM (Local Time) Schedule Type: Recurring Rollout Downloaded At: Jun 14 2007 ...

Not working in Firefox 3.1b2: "Save Image As", "Save Link As", and "Save Page As"
Name: Thaddeus Polit Email: ThaddeusdotPolitatlmcodotcom Product: Firefox Release Candidate Summary: Not working in Firefox 3.1b2: "Save Image As", "Save Link As", and "Save Page As" Comments: Firefox 3.1b2 - When I click "Save Image As", "Save link As", or "Save Page As", nothing happens. The "Save As" dialog does not appear. Due to this problem, I have been forced to start using I.E. Yuck! Please help! Sincerely, Thaddeus Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2) G...

Getting compilation error "The compiler failed with error code 128"
Hi All - I am getting a compilation error when I contact AXMS page , below is the error which i got . Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: The compiler failed with error code 128. when i retstart the system its working fine , but its happening now and then so could not able to predict whats going on .  kindly guide me to eluminate this problem .  Thanks, Jeyaprakash. Tr...

Error: "Encapsulate Field invocation failed with error code 0x8007000e"
I just learned that the C# 2.0 IDE can automatically generate get/set properties for your fields in your classes by right-clicking the variable and selecting Refactor-->Encapsulate Field. But when I try it with my copy of c#, I get the error message "Encapsulate Field invocation failed with error code 0x8007000e" Can anyone tell me why I might be getting this error message? Thanks in advance. Ray  Ray C. Hi, 0x8007000E is E_OUTOFMEMORY Not enough memory to complete the operation. Fortunately, that's not possible. I checked all memory and monitored all files. and everything ...

{"A generic error occurred in GDI+."}, need help on this
Hey   ASP.NET 2.0   This code below causes an {"A generic error occurred in GDI+."} exception at the : "imageFile.Save(Response.OutputStream, ImageFormat.Png);" line.   Any suggestions on what I should do to solve this?   Image imageFile = Image.FromFile(Server.MapPath("~/Images/barometer.png")); Pen pen = new Pen(Color.Black); Graphics newGraphics = Graphics.FromImage(imageFile);LinearGradientBrush linearGradient;   linearGradient = new LinearGradientBrush(    new Point(0, 0),    new Point(162, 10),    Color....

superreview requested: [Bug 298478] Downloads fail with "..could not be saved, because the source file could not be read" (error in JS Console: "Error: uncaught exception:Permission denied to get prop
Chase Phillips <chase@mozilla.org> has asked Daniel Veditz <dveditz@cruzio.com> for superreview: Bug 298478: Downloads fail with "..could not be saved, because the source file could not be read" (error in JS Console: "Error: uncaught exception:Permission denied to get property RegExp.constructor") https://bugzilla.mozilla.org/show_bug.cgi?id=298478 Attachment 187169: Alternative approach, give the component loader its own compilation context https://bugzilla.mozilla.org/attachment.cgi?id=187169&action=edit ...

superreview granted: [Bug 298478] Downloads fail with "..could not be saved, because the source file could not be read" (error in JS Console: "Error: uncaught exception:Permission denied to get proper
Daniel Veditz <dveditz@cruzio.com> has granted Chase Phillips <chase@mozilla.org>'s request for superreview: Bug 298478: Downloads fail with "..could not be saved, because the source file could not be read" (error in JS Console: "Error: uncaught exception:Permission denied to get property RegExp.constructor") https://bugzilla.mozilla.org/show_bug.cgi?id=298478 Attachment 187169: Alternative approach, give the component loader its own compilation context https://bugzilla.mozilla.org/attachment.cgi?id=187169&action=edit ------- Additional Comm...

"an has error occurred in the script on this page" Line: Char: Error: Code: Url:
 OK I'm stumped!Im wring asp.net applications in C#. I have a vista pro laptop devel. machine. I can write code and compile it and tst it with an ocational error in IE, but up to now its been working by reloading any page that gives me an error.Ocationally I get the above error, and when I click on the error in the bottom left of the windoe I usually gen an opject can not be found error, and the error is miraculously fixed by reloading the page!NOW When I try and run an asp.net page in my IE (7.0) I get the error on page error, and it shuts me down from moving to any of the links OR...

Re: SMTP "authentication failed", Message "UGFzc3dvcmQ6" and error code 535
> {quote:title=Kevin Killion wrote:}{quote} > I'm trying to use a TIdSMTP to send an email message, but when issuing the "Send" I'm getting a EIdSMTPReplyError exception, with: > Message: authentication failed: UGFzc3dvcmQ6 > ErrorCode: 535 > > Needless to say, neither the Message nor that ErrorCode tell me much about what went wrong! You stand a better chance of getting answers about Indy components if you ask in the WinSock group instead. Members of the Indy team (at least one or two, anyway) check in there pretty often. (Forums->...

Web resources about - Saving image fails with "A generic error occurred in GDI+." and an error code of -2147467259 for large images only - asp.net.drawinggdi

What to Watch on Tuesday at the Australian Open
MELBOURNE, Australia (AP) — Day Two at the Australian Open features a two-time former champion with a renewed spring in her step, a hard-luck ...

Netflix Announces 11 New Series Premiere Dates
MovieWeb Netflix Announces 11 New Series Premiere Dates MovieWeb The series also stars David Sullivan , Ruth Kearney and George Basil. Executive ...

Kristen Dunst in Chanel at the Critics’ Choice Awards: elegant or overworked?
At the Golden Globes, I was SO pissed off that Lady Gaga won for American Horror Story: Hotel , mostly because I thought the award belonged to ...

For and against: Should Donald Trump be banned from entering Britain?
The Republican candidate for US President has demanded all Muslims to be shut out of the USA, prompting calls to give him the same treatment ...

Why the Carolina Panthers can beat the Arizona Cardinals in NFC title game
Three reasons why the Carolina Panthers can beat the Arizona Cardinals in next Sunday's NFC Championship Game.

Burkina Faso and Mali to coordinate forces after deadly attacks
By Matthew Mpoke Bigg and Nadoun Coulibaly OUAGADOUGOU (Reuters) - Burkina Faso and Mali have agreed to work together to counter the growing ...

7 interesting facts about Martin Luther King Jr.
Dr. Martin Luther King Jr. lived an incredibly fascinating life. Here are seven interesting facts that you might not have known about the American ...

How to restore features Microsoft removed from Windows 10
Windows 10 is a decent operating system, but Microsoft has seen fit to remove certain features found in previous iterations of the OS. If you’ve ...

Rey Mural for a Star Wars Fan
The Force is strong with this family. Emily Rose is an artist. Her seven-year-old daughter is an avid Star Wars fan, and has been all her life. ...

Manning, Broncos rock on after 23-16 win over Steelers
DENVER (AP) — This would've been no way to send Peyton Manning into the offseason.

Resources last updated: 1/18/2016 12:40:40 PM