KAMADA Ken'ichi
f90f5d885a
Mark enum Context and Error as non_exhaustive.
2019-12-22 20:33:56 +09:00
KAMADA Ken'ichi
8825fcca62
Revert the type of Context back from struct to enum.
2019-12-22 20:31:44 +09:00
KAMADA Ken'ichi
4276ed389b
Change Reader::fields() to return an iterator instead of a slice.
2019-12-14 21:57:56 +09:00
KAMADA Ken'ichi
1bd083cbae
Do not reference the raw buffer from Value and Field.
...
Previously, they borrowed the buffer, so users had some difficulty to
manage the lifetime of the buffer and Value/Field. For example,
a user structure was unable to contain both the buffer and a Field.
2019-12-14 21:57:35 +09:00
KAMADA Ken'ichi
1533be5a2a
Mark trait objects explicitly with dyn.
2019-10-21 23:53:43 +09:00
KAMADA Ken'ichi
766822c791
Use ..= for inclusive range pattern.
2019-10-21 23:25:32 +09:00
KAMADA Ken'ichi
f81d2f6e6a
Change the type of Context from enum to struct.
2019-10-21 23:12:58 +09:00
KAMADA Ken'ichi
4829149cf7
Remove #[inline] because Tag::unit is not public to other crates.
2019-04-12 23:36:38 +09:00
KAMADA Ken'ichi
e1e4800eea
Implement From<(u32, u32)> for Rational and i32 version for SRational.
2019-04-12 23:35:28 +09:00
KAMADA Ken'ichi
2ffa449d9d
Support displaying a value with its unit.
...
- Field::display_value and DisplayValue::with_unit were introduced.
- The string "centimeter" was changed to "cm" for consistency
with "m", "mm", and "km".
- F-number was changed to be prefixed by "f/" only when with_unit() is
called, though it is actually not a unit.
2019-04-07 21:11:14 +09:00
KAMADA Ken'ichi
eb4723a8a9
Migrate to Rust 2018.
2019-04-01 21:11:54 +09:00
KAMADA Ken'ichi
56106534cd
Remove the deprecated tag module.
2019-03-31 23:50:04 +09:00
KAMADA Ken'ichi
f9c4ff475b
Use u8::is_ascii_uppercase() stabilized in Rust 1.24.
2019-03-27 23:16:05 +09:00
Kornel
9c45d1903a
Replace try!() with ?
2018-04-17 23:21:40 +09:00
KAMADA Ken'ichi
c2912228c9
Update the description for Flash field.
2018-02-19 23:35:34 +09:00
KAMADA Ken'ichi
0f6698eb55
Explicit static lifetimes are no longer needed for constants in Rust 1.17.
2018-02-19 23:25:24 +09:00
KAMADA Ken'ichi
2ecdb77efe
Remove an unnecessary ref.
2018-01-18 23:40:05 +09:00
KAMADA Ken'ichi
d882dce9a0
Update documentation and doc-tests.
2018-01-13 23:33:45 +09:00
KAMADA Ken'ichi
63fa7373e6
Remove Tag::value(), which has been deprecated since 0.2.0.
2017-10-22 16:13:30 +09:00
KAMADA Ken'ichi
26a64361b3
Add `Tag::TagName`s and deprecate `tag::TagName`s.
2017-10-12 22:55:56 +09:00
KAMADA Ken'ichi
078bfcdc78
Add the 2nd member to Value::Undefined to keep the offset of the value.
2017-08-04 21:15:19 +09:00
KAMADA Ken'ichi
561e801c88
Stringify GPS directions (N/W/S/E) as unquoted.
2017-07-23 21:43:02 +09:00
KAMADA Ken'ichi
db718fe75a
Derive Hash trait for Tag and Context.
2017-07-11 23:29:26 +09:00
KAMADA Ken'ichi
b8aefa2722
Support tiled TIFF images.
...
This is just for convenience in case the primary image is tiled.
Tiled images are not part of the Exif 2.31 standard or the TIFF 6.0
baseline specification.
2017-07-07 22:21:44 +09:00
KAMADA Ken'ichi
d348ceb54b
Fix the display strings of the LightSource field.
2017-07-07 22:20:09 +09:00
KAMADA Ken'ichi
62bf989fa9
Fix a typo and a "tag value" that has been overlooked.
2017-06-25 20:33:27 +09:00
KAMADA Ken'ichi
5a540228c3
Implement the body of Value::display_as().
2017-06-17 21:57:38 +09:00
KAMADA Ken'ichi
0d9551af0f
Add a struct for displaying a value in a tag-specific way.
2017-05-11 23:19:16 +09:00
KAMADA Ken'ichi
3736693836
Treat the built-in tag information as static data.
2017-05-11 23:18:33 +09:00
KAMADA Ken'ichi
accc66f21a
Test std::fmt::Display for Tag.
2017-04-08 20:26:51 +09:00
KAMADA Ken'ichi
2b663f35f3
Rename Tag.value() to Tag.number().
...
The purpose of this change is to avoid confusion with field values.
The TIFF standard basically just calls it as a "tag",
but "tag number" is used a few times.
2017-03-24 23:32:12 +09:00
KAMADA Ken'ichi
7f66863d84
Add Tag.default_value().
2017-03-24 22:46:26 +09:00
KAMADA Ken'ichi
c9ccdc343a
Derive Copy and Clone traits for Tag for future APIs.
2017-03-15 23:42:14 +09:00
KAMADA Ken'ichi
e939ef7fd6
Do not re-export Content and Tag by hiding the real tag module.
2017-03-12 19:18:00 +09:00
KAMADA Ken'ichi
566eb47719
Add constants for the new tags in Exif 2.31.
2017-03-04 21:26:03 +09:00
KAMADA Ken'ichi
de37fa8f00
Test if a constant variable can be used in the match arm.
2016-12-14 22:08:51 +09:00
KAMADA Ken'ichi
e894654d68
Reduce the object size of the big match in get_tag_info().
2016-12-14 22:02:55 +09:00
KAMADA Ken'ichi
5cb98a8f1b
Allow Exif and other IFDs in the thumbnail image.
...
The Exif specfication allows Exif/GPS/Interoperability IFDs in the
thumbnail image (1st IFD) as well as in the primary one (0th IFD).
Do not define separate sets of tag constants for primary and thumbnail
images because it doubles the number of constants. Instead, add a
flag in struct Field to distinguish them.
2016-12-12 21:27:35 +09:00
KAMADA Ken'ichi
05e5852918
Add constants for tags defined in the Exif specification.
2016-12-06 22:08:47 +09:00
KAMADA Ken'ichi
66c92e0441
Avoid repeating contexts in tag constants definition.
2016-12-06 22:05:43 +09:00
KAMADA Ken'ichi
d180bfbae8
Add Tag::description() and implement fmt::Display for Tag.
2016-11-24 22:23:05 +09:00
KAMADA Ken'ichi
6651b7d159
Parse IFD structures and record the context in Tag.
...
In the Exif specification, IFDs may be nested and chained.
The interpretation of a tag value depends on the IFD in which it
appears, so the context is added into Tag.
2016-11-23 19:06:38 +09:00
KAMADA Ken'ichi
0e9512472c
Parse TIFF IFD structure.
2016-10-26 22:46:20 +09:00