Using the standard library for working with pictures in .net, you can add your own metadata to pictures, in other words exif. Actually the question is, but when adding metadata and saving the file, is the original file completely overwritten or does the metadata quickly get recorded? If the first, is it possible to somehow only record information, without overwriting the entire file? The fact is that a full rewriting of a file will negatively affect performance if it is necessary to prescribe metadata for a large number of files.

  • And which of the libraries do you mean? Winforms or WPF? Both are standard. - VladD
  • @VladD Winforms. Does WPF have something for working with pictures? How many examples did not look for, all use the Image primitive from WinForms. - iluxa1810
  • The whole mountain: msdn.microsoft.com/en-us/library/… . Only descendants of BitmapSource 10 pieces. - VladD
  • @VladD, do they completely cover WinForms (Drawing) functionality or does it still have to take something from there from time to time? Is the performance better? If I'm not mistaken, is there a video card used, not a processor? - iluxa1810
  • It's hard for me to answer that, I have never done a comparison. I always had the WPF functionality for working with pictures. - VladD

1 answer 1

I have not seen anywhere else in .NET recording files (except text).

The reason is simple. Let you read some object into memory from a file, modify it, and write it back. In order for the backup to make sense, your recording must occur in the same file, there must be some guarantee that the data in the file has not changed during processing, and your changes to the object must be placed in the file strictly after the information already entered into the file , or do not change the length of the file.

All these conditions are quite complex, and lead to optimization in a fairly small percentage of use cases. Therefore, the answer is no, the file will be completely rewritten.


If you need this optimization, the best thing is probably to write your own bike, which will only deal with editing metadata. You will have to master the necessary file formats, yes.