I can get a file's properties/metadata by calling Shell32.Folder.GetDetailsOf
, but I can't seem to figure out how to modify those attributes. The properties I'm referring to are the "extended details" like Camera model and Camera name for image files.
Asked
Active
Viewed 8,864 times
0
-
Can't do it for images, unfortunately, as EXIF data is at the start of the binary for the image and takes up a fixed amount of space. – Brian Driscoll Aug 31 '11 at 19:32
-
`Folder.GetDetailsOf` is a vba method, not a .NET one. You tagged the question C#. Please clarify. – Oded Aug 31 '11 at 19:32
1 Answers
3
IF you are indeed using C# then you must do some Interop/PInvoke to call that method since that is Shell method...
To get+set EXIF information you can use the Image
class (though not optimal), for the standard attributes you can use the FileInfo
class.
A very good class for doing EXIF related stuff including source can be found here.

Yahia
- 69,653
- 9
- 115
- 144
-
The class in your last link is certainly very helpful in dealing with, but it doesn't look like it can set EXIF information at the moment. Also, why is the `Image` class not optimal for setting EXIF? – rafale Sep 01 '11 at 06:23
-
AFAIK using `Image` class can result in rewriting the image file which can incurr depending on the file format etc. a possible slight loss in quality... another point is that it loads the image into memory which can be a performance issue if you only want to deal with the EXIF data... – Yahia Sep 01 '11 at 11:07
-
It looks like using `Image` is my only choice at this moment. I can't seem to find any other libraries or classes that can modify EXIF information. – rafale Sep 01 '11 at 20:18
-
there are several commercial ones available if that is an option I could give you some links... – Yahia Sep 01 '11 at 22:04