-
-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
Hello @amerkoleci, great job on Vortice.
Regarding WIC metadata, no matter what I try an encoded JPEG never contains any EXIF or XMP metadata:
using (var factory = new IWICImagingFactory())
using (var encoder = factory.CreateEncoder(ContainerFormat.Jpeg))
using (var stream = new FileStream(filePath, FileMode.Create))
{
encoder.Initialize(stream, BitmapEncoderCacheOption.NoCache);
using (var frame = encoder.CreateNewFrame(out var props))
{
frame.Initialize(props);
frame.SetSize(width, height);
...
frame.SetPixelFormat(ref pixelFormat);
frame.WriteSource(converter);
...
props.Set("ImageQuality", quality);
using (var writer = frame.MetadataQueryWriter)
{
writer.SetMetadataByName("/app1/ifd/{ushort=271}", new() { Value = "Custom Camera" });
writer.SetMetadataByName("/app1/ifd/{ushort=40091}", new() { Value = "My Title" });
metadata.SetMetadataByName("/xmp/dc:title", new() { Value = "My Image Title" });
frame.Commit();
encoder.Commit();
}
}
}
SetMetadataByName doesn't fail for those names (a non-existing name does fail), is this the right way to pass Variants? Maybe it fails silently since the marshalled variant is unexpected or invalid?
Since no metadata encoded, am I missing anything?
Thank you in advance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels