D
David Veeneman
I'm opening a JPG file to read and write its EXIF properties. I'm using very
simple code to open the file:
myBitmap = new Bitmap(filePath);
Reading and writing the properties is working fine, but when I go to save
the file, I'm getting an exception that reads "A generic error occurred in
GDI+." Here's the code I'm using to save the file back to the same name it
was opened from:
myBitmap.Save(filePath, ImageFormat.Jpeg);
I tried saving to a different file name, and that save works with no
problems. That suggests a file-locking problem.
Presumably, my app is putting a lock on the JPG file when I open it. How can
I release the lock, so I can write modified properties back to the file?
Thanks in advance for your help.
simple code to open the file:
myBitmap = new Bitmap(filePath);
Reading and writing the properties is working fine, but when I go to save
the file, I'm getting an exception that reads "A generic error occurred in
GDI+." Here's the code I'm using to save the file back to the same name it
was opened from:
myBitmap.Save(filePath, ImageFormat.Jpeg);
I tried saving to a different file name, and that save works with no
problems. That suggests a file-locking problem.
Presumably, my app is putting a lock on the JPG file when I open it. How can
I release the lock, so I can write modified properties back to the file?
Thanks in advance for your help.