I have a problem saving the image after changing its metadata. Basically, I want to open my image, display it, change its EXIF metadata and save it.
Firstly, I had a problem saving my image because the source file was locked (I had a general GTI + error). After reading some posts here and finding out what the problem is, I solved the blocking problem using the using keyword.
But the problem is that if I use "using", the list of Ilems properties of my image is empty, and I cannot change my metadata.
This is how I upload my image (with different tests)
this.image = new Bitmap(this.path);
Using streamReader or MemoryStream does not help ...
And this is how I change and save my image:
PropertyItem p = this.photo.Image.GetPropertyItem(0x5090);
p.Id = 0x320;
p.Type = 2;
p.Len = boxTitle.Text.Length;
p.Value = Encoding.ASCII.GetBytes(boxTitle.Text);
this.photo.Image.SetPropertyItem(p);
this.photo.Image.Save(this.photo.Path);
, , "" , ?