C# image /xmp/projectionType setquery error : (add image meta data /xmp/projectionType)

210 Views Asked by At

My goal is set value to "/xmp/projectionType" meta data for jpeg image.

I can set "text/descryption" by following code but error throwing when I try to set value for "/xmp/ProjectionType"

 using (FileStream fs = new FileStream(@"fullfilePath",FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
            {
                BitmapSource img = BitmapFrame.Create(fs);
                BitmapMetadata md = (BitmapMetadata)img.Metadata.Clone();
                // below set query working fine
                md.SetQuery("/Text/Description", "Have a nice day.");
                // below set query throws error
                md.SetQuery("/xmp/ProjectionType", "equirectangular");
            }

Error:

An unhandled exception of type 'System.ArgumentException' occurred in PresentationCore.dll

Additional information: Value does not fall within the expected range.

How to insert "/xmp/projectionType" ?

0

There are 0 best solutions below