Skip to main content

ExifTag

Enum ExifTag 

Source
#[non_exhaustive]
pub enum ExifTag {
Show 128 variants Make = 271, Model = 272, Orientation = 274, ImageWidth = 256, ImageHeight = 257, ISOSpeedRatings = 34_855, ShutterSpeedValue = 37_377, ExposureTime = 33_434, FNumber = 33_437, ExifImageWidth = 40_962, ExifImageHeight = 40_963, DateTimeOriginal = 36_867, CreateDate = 36_868, ModifyDate = 306, OffsetTime = 36_880, OffsetTimeOriginal = 36_881, OffsetTimeDigitized = 36_882, GPSLatitudeRef = 1, GPSLatitude = 2, GPSLongitudeRef = 3, GPSLongitude = 4, GPSAltitudeRef = 5, GPSAltitude = 6, GPSVersionID = 0, ExifOffset = 34_665, GPSInfo = 34_853, ImageDescription = 270, XResolution = 282, YResolution = 283, ResolutionUnit = 296, Software = 305, HostComputer = 316, WhitePoint = 318, PrimaryChromaticities = 319, YCbCrCoefficients = 529, ReferenceBlackWhite = 532, Copyright = 33_432, ExposureProgram = 34_850, SpectralSensitivity = 34_852, OECF = 34_856, SensitivityType = 34_864, ExifVersion = 36_864, ApertureValue = 37_378, BrightnessValue = 37_379, ExposureBiasValue = 37_380, MaxApertureValue = 37_381, SubjectDistance = 37_382, MeteringMode = 37_383, LightSource = 37_384, Flash = 37_385, FocalLength = 37_386, SubjectArea = 37_396, MakerNote = 37_500, UserComment = 37_510, FlashPixVersion = 40_960, ColorSpace = 40_961, RelatedSoundFile = 40_964, FlashEnergy = 41_483, FocalPlaneXResolution = 41_486, FocalPlaneYResolution = 41_487, FocalPlaneResolutionUnit = 41_488, SubjectLocation = 41_492, ExposureIndex = 41_493, SensingMethod = 41_495, FileSource = 41_728, SceneType = 41_729, CFAPattern = 41_730, CustomRendered = 41_985, ExposureMode = 41_986, WhiteBalanceMode = 41_987, DigitalZoomRatio = 41_988, FocalLengthIn35mmFilm = 41_989, SceneCaptureType = 41_990, GainControl = 41_991, Contrast = 41_992, Saturation = 41_993, Sharpness = 41_994, DeviceSettingDescription = 41_995, SubjectDistanceRange = 41_996, ImageUniqueID = 42_016, CameraSerialNumber = 42_033, LensSpecification = 42_034, LensMake = 42_035, LensModel = 42_036, LensSerialNumber = 42_037, Gamma = 42_240, GPSTimeStamp = 7, GPSSatellites = 8, GPSStatus = 9, GPSMeasureMode = 10, GPSDOP = 11, GPSSpeedRef = 12, GPSSpeed = 13, GPSTrackRef = 14, GPSTrack = 15, GPSImgDirectionRef = 16, GPSImgDirection = 17, GPSMapDatum = 18, GPSDestLatitudeRef = 19, GPSDestLatitude = 20, GPSDestLongitudeRef = 21, GPSDestLongitude = 22, GPSDestBearingRef = 23, GPSDestBearing = 24, GPSDestDistanceRef = 25, GPSDestDistance = 26, GPSProcessingMethod = 27, GPSAreaInformation = 28, GPSDateStamp = 29, GPSDifferential = 30, ProcessingSoftware = 65_547, InteropIndex = 131_073, InteropVersion = 131_074, YCbCrPositioning = 531, RecommendedExposureIndex = 34_866, SubSecTimeDigitized = 37_522, SubSecTimeOriginal = 37_521, SubSecTime = 37_520, InteropOffset = 40_965, ComponentsConfiguration = 37_121, ThumbnailOffset = 513, ThumbnailLength = 514, Compression = 259, BitsPerSample = 258, PhotometricInterpretation = 262, SamplesPerPixel = 277, RowsPerStrip = 278, PlanarConfiguration = 284,
}
Expand description

Defines recognized Exif tags. All tags can be parsed, no matter if it is defined here. This enum definition is just for ease of use.

You can always get the entry value by raw tag code which is an u16 value. See ExifIterEntry::tag (returns TagOrCode which exposes .code()) and Exif::get_by_code.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Make = 271

§

Model = 272

§

Orientation = 274

§

ImageWidth = 256

§

ImageHeight = 257

§

ISOSpeedRatings = 34_855

§

ShutterSpeedValue = 37_377

§

ExposureTime = 33_434

§

FNumber = 33_437

§

ExifImageWidth = 40_962

§

ExifImageHeight = 40_963

§

DateTimeOriginal = 36_867

§

CreateDate = 36_868

§

ModifyDate = 306

§

OffsetTime = 36_880

§

OffsetTimeOriginal = 36_881

§

OffsetTimeDigitized = 36_882

§

GPSLatitudeRef = 1

§

GPSLatitude = 2

§

GPSLongitudeRef = 3

§

GPSLongitude = 4

§

GPSAltitudeRef = 5

§

GPSAltitude = 6

§

GPSVersionID = 0

§

ExifOffset = 34_665

§

GPSInfo = 34_853

§

ImageDescription = 270

§

XResolution = 282

§

YResolution = 283

§

ResolutionUnit = 296

§

Software = 305

§

HostComputer = 316

§

WhitePoint = 318

§

PrimaryChromaticities = 319

§

YCbCrCoefficients = 529

§

ReferenceBlackWhite = 532

§

Copyright = 33_432

§

ExposureProgram = 34_850

§

SpectralSensitivity = 34_852

§

OECF = 34_856

§

SensitivityType = 34_864

§

ExifVersion = 36_864

§

ApertureValue = 37_378

§

BrightnessValue = 37_379

§

ExposureBiasValue = 37_380

§

MaxApertureValue = 37_381

§

SubjectDistance = 37_382

§

MeteringMode = 37_383

§

LightSource = 37_384

§

Flash = 37_385

§

FocalLength = 37_386

§

SubjectArea = 37_396

§

MakerNote = 37_500

§

UserComment = 37_510

§

FlashPixVersion = 40_960

§

ColorSpace = 40_961

§

RelatedSoundFile = 40_964

§

FlashEnergy = 41_483

§

FocalPlaneXResolution = 41_486

§

FocalPlaneYResolution = 41_487

§

FocalPlaneResolutionUnit = 41_488

§

SubjectLocation = 41_492

§

ExposureIndex = 41_493

§

SensingMethod = 41_495

§

FileSource = 41_728

§

SceneType = 41_729

§

CFAPattern = 41_730

§

CustomRendered = 41_985

§

ExposureMode = 41_986

§

WhiteBalanceMode = 41_987

§

DigitalZoomRatio = 41_988

§

FocalLengthIn35mmFilm = 41_989

§

SceneCaptureType = 41_990

§

GainControl = 41_991

§

Contrast = 41_992

§

Saturation = 41_993

§

Sharpness = 41_994

§

DeviceSettingDescription = 41_995

§

SubjectDistanceRange = 41_996

§

ImageUniqueID = 42_016

§

CameraSerialNumber = 42_033

§

LensSpecification = 42_034

§

LensMake = 42_035

§

LensModel = 42_036

§

LensSerialNumber = 42_037

§

Gamma = 42_240

§

GPSTimeStamp = 7

§

GPSSatellites = 8

§

GPSStatus = 9

§

GPSMeasureMode = 10

§

GPSDOP = 11

§

GPSSpeedRef = 12

§

GPSSpeed = 13

§

GPSTrackRef = 14

§

GPSTrack = 15

§

GPSImgDirectionRef = 16

§

GPSImgDirection = 17

§

GPSMapDatum = 18

§

GPSDestLatitudeRef = 19

§

GPSDestLatitude = 20

§

GPSDestLongitudeRef = 21

§

GPSDestLongitude = 22

§

GPSDestBearingRef = 23

§

GPSDestBearing = 24

§

GPSDestDistanceRef = 25

§

GPSDestDistance = 26

§

GPSProcessingMethod = 27

§

GPSAreaInformation = 28

§

GPSDateStamp = 29

§

GPSDifferential = 30

§

ProcessingSoftware = 65_547

0x000b in the TIFF namespace (GPSDOP uses the same code in GPS).

§

InteropIndex = 131_073

0x0001 in the Interop namespace (GPSLatitudeRef in GPS).

§

InteropVersion = 131_074

0x0002 in the Interop namespace (GPSLatitude in GPS).

§

YCbCrPositioning = 531

§

RecommendedExposureIndex = 34_866

§

SubSecTimeDigitized = 37_522

§

SubSecTimeOriginal = 37_521

§

SubSecTime = 37_520

§

InteropOffset = 40_965

§

ComponentsConfiguration = 37_121

§

ThumbnailOffset = 513

§

ThumbnailLength = 514

§

Compression = 259

§

BitsPerSample = 258

§

PhotometricInterpretation = 262

§

SamplesPerPixel = 277

§

RowsPerStrip = 278

§

PlanarConfiguration = 284

Implementations§

Source§

impl ExifTag

Source

pub const fn code(self) -> u16

Source

pub const fn name(self) -> &'static str

Source

pub fn from_code_in(kind: IfdKind, code: u16) -> Option<Self>

Resolve a raw code within a known IFD namespace.

Unlike Self::from_code this cannot mislabel: a code that the given namespace does not define returns None rather than falling through to some other namespace’s meaning.

Source

pub fn namespace(self) -> Option<IfdKind>

The namespace that defines this tag, but only when its code is ambiguous — i.e. some other IFD assigns a different tag to the same code. Returns None for codes with a single meaning, which can safely be looked up in any namespace.

use nom_exif::{ExifTag, IfdKind};

assert_eq!(ExifTag::GPSDOP.namespace(), Some(IfdKind::Gps));
assert_eq!(ExifTag::ProcessingSoftware.namespace(), Some(IfdKind::Tiff));
assert_eq!(ExifTag::Make.namespace(), None); // 0x010f means Make everywhere
Source

pub fn from_code(code: u16) -> Option<Self>

Trait Implementations§

Source§

impl Clone for ExifTag

Source§

fn clone(&self) -> ExifTag

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExifTag

Source§

impl Debug for ExifTag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ExifTag

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ExifTag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ExifTag

Source§

impl FromStr for ExifTag

Source§

type Err = ConvertError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for ExifTag

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ExifTag

Source§

fn eq(&self, other: &ExifTag) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ExifTag

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ExifTag

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more