Question: Writing EXIF
See original GitHub issueHello there,
Hoping this is a quick one. How to insert IFD2/Lens tags into an image? I was able to set many other tags without any issues, anything related to Lens info (exif-ifd2-LensModel
, exif-ifd2-LensSpecification
, exif-ifd2-LensSerialNumber
, exif-ifd2-LensMake
) does not seem to work.
using var image = NetVips.Image.NewFromFile(Path.Join(_path, "img_no_exif.jpg"));
image.Mutate(m => m.Set(GValue.GStrType, "exif-ifd2-LensMake", "Canon"));
image.WriteToFile(Path.Combine(_path, "img_with_lens_info.jpg"));
using var exifed = NetVips.Image.NewFromFile(Path.Join(_path, "img_with_lens_info.jpg"));
bool hasLensMake = exifed.Contains("exif-ifd2-LensMake");
Side note: I tried both GValue.GStrType
and GValue.RefStrType
with no luck. For other tags, I figured out how to successfully set certain values through trial and error - for example, while working with other numeric fields (say exif-ifd2-FNumber
), instead of directly using GValue.GDoubleType
I had to convert it to a rational string and then use the type GValue.RefStrType
to successfully set. But this simple string field, I just can’t get to the bottom of it.
Thank you in advance!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
We aim for a release in late May, see: https://github.com/libvips/libvips/issues/2790. Setting
exif-ifd2-LensSpecification
should be possible after PR https://github.com/libexif/libexif/pull/85, e.g.:Thank you, super excited about the other new features as well!