gufo_common/
field.rs

1//! Metadata fields
2//!
3//! Definition of metadata fields that can be looked up from various formats.
4//! Currently supported are Exif and XMP.
5
6mod macros;
7
8use crate::exif::Ifd;
9
10// Exif
11macros::make_tags![
12    // GPS
13    (0x1, GPSLatitudeRef, Ifd::Gps),
14    (0x2, GPSLatitude, Ifd::Gps),
15    (0x3, GPSLongitudeRef, Ifd::Gps),
16    (0x4, GPSLongitude, Ifd::Gps),
17    (0x5, GPSAltitudeRef, Ifd::Gps),
18    (0x6, GPSAltitude, Ifd::Gps),
19    (0x10, GPSImgDirectionRef, Ifd::Gps),
20    (0x11, GPSImgDirection, Ifd::Gps),
21    (0x12, GPSSpeedRef, Ifd::Gps),
22    (0x13, GPSSpeed, Ifd::Gps),
23
24    // Primary
25    (0x100, ImageWidth, Ifd::Primary, xmp = Exif),
26    (0x10E, ImageDescription, Ifd::Primary),
27    (0x10F, Make, Ifd::Primary, xmp = Tiff),
28    (0x110, Model, Ifd::Primary, xmp = Tiff),
29    /// Image orientation and mirroring
30    (0x112, Orientation, Ifd::Primary, xmp = Exif),
31    (0x112, ThumbnailOrientation, Ifd::Thumbnail),
32    (0x11A, XResolution, Ifd::Primary, xmp = Exif),
33    /// The XMP equivalent is [`CreatorTool`]
34    (0x131, Software, Ifd::Primary),
35
36    // Thumbnail
37    (0x100, ThumbnailImageWidth, Ifd::Thumbnail, xmp = Exif),
38
39    // Exif
40    (0x829A, ExposureTime, Ifd::Exif, xmp = Exif),
41    (0x829D, FNumber, Ifd::Exif, xmp = Exif),
42    /// Also called ISOSpeedRatings (new xmp value since Exif 2.3 or later)
43    (0x8827, PhotographicSensitivity, Ifd::Exif, xmp = ExifEX),
44    (0x9003, DateTimeOriginal, Ifd::Exif, xmp = Exif),
45    (0x9011, OffsetTimeOriginal, Ifd::Exif),
46    (0x9286, UserComment, Ifd::Exif, xmp = Exif),
47    (0x9291, SubSecTimeOriginal, Ifd::Exif),
48    /// Lens aperture with unit APEX
49    (0x9202, Aperture, Ifd::Exif, xmp = Exif),
50    (0x920A, FocalLength, Ifd::Exif, xmp = Exif),
51    (0xA430, CameraOwnerName, Ifd::Exif, xmp = ExifEX),
52    (0xA433, LensMake, Ifd::Exif, xmp = Exif),
53    (0xA434, LensModel, Ifd::Exif, xmp = Exif),
54];
55
56macros::make_exif_tags!((0x9, CanonOwnerName, Ifd::MakerNote),);
57
58macros::make_xmp_tags![
59    /// Legacy XMP Exif (till Exif 2.21)
60    (ISOSpeedRatings, Exif)
61];
62
63// Dublin Core
64macros::make_xmp_tags![(Creator, "creator", Dc)];
65
66// XMP
67macros::make_xmp_tags![(CreatorTool, Xmp)];