[CSHARP-949] Follow up on CSHARP-947 Created: 10/Apr/14  Updated: 05/Apr/19  Resolved: 20/Jun/14

Status: Closed
Project: C# Driver
Component/s: API
Affects Version/s: 1.9
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Anatoly Molotkov [X] Assignee: Unassigned
Resolution: Done Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows


Issue Links:
Duplicate
duplicates CSHARP-947 Programming with MongoGridFS and chun... Closed

 Description   

Robert, one issue I ran into is strange. I am able to save and restore, and the image appears to be correct. However, whenever I hit Save again, I get this error on the line bitmap.Save(stream, ImageFormat.Bmp);. I'm curious what I should review about the image restored back from the db to identify the cause. The error is:

System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+. \r\n at System.Drawing.Image.Save (Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)\r\n

Thank you!



 Comments   
Comment by Robert Stam [ 14/Apr/14 ]

This probably isn't a MongoDB issue, but rather has to do with how the image is being saved as a byte array and read back.

You could remove MongoDB from the equation by attempting to save the bitmap to a local file on the hard drive and reading it back (maybe two round trips to convince yourself both directions are working).

Generated at Wed Feb 07 21:38:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.