I have the following code:
try
{
fi = new FileInfo(fn); //fn is a string from a windows form,
identifying the jpg in the file system
fullPath = fi.DirectoryName + "\\" + fi.Name;
Image bm = Image.FromFile(fullPath, true); //create an image
object from the file identifier
//bm.Tag = txtTag.Text; -- various attempts to set the
Image.Tag, inactivated for this test
//bm.Tag = (object)txtTag.Text;
bm.Save(fullPath, jpg); //this generates a "generic GDI+
error, trapped by a catch block on
//an unspecified exception -- catch(Exception ex)
}
//end code sample
//since I am in the code above merely loading the jpg and trying to save it
without any modification, I don't quite understand what has caused the
error. Any advice appreciated. I'm a neophyte at C#.
Mark Harris
St. Petersburg, FL
Misbah Arefin - 29 Feb 2008 20:10 GMT
The Image.Save(string, format) is supposed to throw an exception if saved to
the same file it was created from
http://msdn2.microsoft.com/en-us/library/9t4syfhh.aspx

Signature
Misbah Arefin
https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
http://www.linkedin.com/in/misbaharefin
> I have the following code:
>
[quoted text clipped - 22 lines]
> Mark Harris
> St. Petersburg, FL