Commit Graph

145 Commits

Author SHA1 Message Date
KAMADA Ken'ichi 1533be5a2a Mark trait objects explicitly with dyn. 2019-10-21 23:53:43 +09:00
KAMADA Ken'ichi 23c2c189da Use std::error::Error::source; cause was deprecated in Rust 1.33. 2019-10-21 23:30:46 +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 b584930a78 Fix the lifetime annotation on DisplayValue::with_unit. 2019-07-20 21:30:30 +09:00
KAMADA Ken'ichi 8a7049c9b3 Support writing the 2nd and further IFDs. 2019-06-02 23:16:18 +09:00
KAMADA Ken'ichi 8e9ff50ca8 Support reading up to 8 IFDs. 2019-05-08 23:09:03 +09:00
KAMADA Ken'ichi b9575efd0b Add struct In (IFD number) to indicate primary/thumbnail images. 2019-04-20 23:16:01 +09:00
KAMADA Ken'ichi 6c3ddddc96 Remove an empty line. 2019-04-13 19:45:00 +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 437b1a1750 Eliminate unnecessary use of format! macro.
- Use Display::to_string in tests for conciseness.
- panic! directly takes format!-like arguments.
2019-04-09 23:11:05 +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
KAMADA Ken'ichi d04939182d Use from_be_bytes in one more place. 2019-03-26 23:25:46 +09:00
KAMADA Ken'ichi 46510fef82 Merge a patch from kpcyrd to remove some unsafe blocks.
A part of the patch involves copying or initializing arrays, but the
performance impact should be negligible.  TryFrom will eliminate copying
when stabilized.
2019-03-26 23:17:31 +09:00
KAMADA Ken'ichi 03a7694c52 The generate_write macro no longer needs type_size argument. 2019-03-26 23:05:08 +09:00
KAMADA Ken'ichi 3429587392 Wrap a line to fit with 80-column terminals. 2019-03-26 23:02:34 +09:00
kpcyrd 288a7e85c5 Remove some usage of unsafe rust 2019-03-17 23:55:10 +09:00
KAMADA Ken'ichi 4874c69c24 Require Rust 1.33 or later. 2019-03-17 23:34:19 +09:00
KAMADA Ken'ichi 9a9a605a82 Increment the version to 0.3.1. 2018-06-17 21:51:49 +09:00
KAMADA Ken'ichi 8b06acb3dd Do not treat IFD2 and beyond as an error; just ignore them. 2018-06-17 21:34:56 +09:00
KAMADA Ken'ichi bbca6ea229 Use {f32,f64}::{from_bits,to_bits} instead of unsafe transmute.
These APIs were stabilized in Rust 1.20.0.
2018-04-20 22:16:21 +09:00
KAMADA Ken'ichi 7fcd64b40b Mention the name on crate.io to reduce confusion. 2018-04-17 23:33:39 +09:00
Andrei Oprea 9c2440b7eb Update README to refer kamadak-exif on crates.io 2018-04-17 23:28:23 +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 827491a769 Reduce the scope of a variable. 2018-01-15 23:01:10 +09:00
KAMADA Ken'ichi d882dce9a0 Update documentation and doc-tests. 2018-01-13 23:33:45 +09:00
KAMADA Ken'ichi 201f6887fd Remove an unused mut. 2017-10-28 00:14:41 +09:00
KAMADA Ken'ichi 2fab18947a Increment the version to 0.3. 2017-10-22 16:19:18 +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 7046070a83 The previous commit requires Rust 1.20. 2017-10-12 22:57:51 +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 1ad83d8a82 Add nanosecond and time_offset fields in struct DateTime. 2017-10-01 21:17:17 +09:00
KAMADA Ken'ichi 836244fde3 Derive Debug trait for Writer. 2017-10-01 21:16:05 +09:00
KAMADA Ken'ichi 98cb8b914c Remove ImageWidth/Length from tests/exif.jpg for conformance to Exif. 2017-08-21 21:13:36 +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 eba51f05c7 Check if a child IFD pointer is an unsigned integer. 2017-07-27 20:42:29 +09:00
KAMADA Ken'ichi 51bfc6b21f Align the offset handling of unknown types with the doc comment. 2017-07-26 23:27:48 +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 fab83f512f Add examples/dumpexif.rs. 2017-07-23 21:41:10 +09:00
KAMADA Ken'ichi a4f891ec25 Add Error::TooBig and NotSupported. 2017-07-18 22:42:45 +09:00
KAMADA Ken'ichi aa41b66838 Reset the compatibility notes for version 0.3. 2017-07-18 22:36:27 +09:00
KAMADA Ken'ichi c5f25db4fd Increment the version to 0.2.3. 2017-07-16 15:28:28 +09:00
KAMADA Ken'ichi 8ffc5ced3f Add an example to read various fields. 2017-07-16 15:16:56 +09:00
KAMADA Ken'ichi 0616fed483 Test if a Writer can be written twice. 2017-07-12 21:37:13 +09:00
KAMADA Ken'ichi ad7ccec2f0 Fix offset calculation: - has a higher precedence than <<. 2017-07-12 21:36:42 +09:00
KAMADA Ken'ichi caafd20aad Add tests/rwrcmp.rs to test Writer.
It reads Exif data, writes, re-reads, and compare the results.
2017-07-11 23:36:28 +09:00
KAMADA Ken'ichi f0a9297579 Add Value::iter_uint(). 2017-07-11 23:33:14 +09:00
KAMADA Ken'ichi 165f95fc8e Add Reader::get_field().
Specify the same type for the input/output of a transmute
when it is not expected to change the type.
2017-07-11 23:30:48 +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 9eb8944833 Add tests for Writer. 2017-07-04 20:56:19 +09:00
KAMADA Ken'ichi e8000ac50c Do not output the thumbnail IFD if there are no data in it. 2017-07-02 21:51:25 +09:00
KAMADA Ken'ichi 73bced6cbf Add an experimental Writer that encodes and writes Exif data. 2017-07-01 19:17:37 +09:00
KAMADA Ken'ichi 132c9e9d18 Implement the encoder for the field values. 2017-06-30 23:23:03 +09:00
KAMADA Ken'ichi a49a8be441 Add endian::writeu16, writeu32, and writeu64. 2017-06-29 23:19:53 +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 0949abc4ac Increment the version to 0.2.2. 2017-06-17 22:49:08 +09:00
KAMADA Ken'ichi 5a540228c3 Implement the body of Value::display_as(). 2017-06-17 21:57:38 +09:00
KAMADA Ken'ichi 7c61ddf3f9 Add Value::get_uint() to handle BYTE, SHORT, and LONG transparently. 2017-06-17 21:47:27 +09:00
KAMADA Ken'ichi 8f2ece2b01 Implement std::fmt::Display trait for DateTime. 2017-06-17 21:43:59 +09:00
KAMADA Ken'ichi 065276d5a1 Add converters from Rational/SRational to f64/f32.
- Rational::to_f64() and SRational::to_f64().
- From<Rational> and From<SRational> traits for f64 and f32.
2017-06-14 23:28:20 +09:00
KAMADA Ken'ichi 94e62181eb Derive Copy and Clone traits for Rational and SRational. 2017-06-14 23:23:53 +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 91ce94844c Implement std::fmt::Display for Rational and SRational. 2017-04-08 20:21:54 +09:00
KAMADA Ken'ichi a83a0fc8eb Use assert_ne!() for symmetry. 2017-04-08 20:19:04 +09:00
KAMADA Ken'ichi 0c34e29ecb Increment the version to 0.2.1. 2017-03-27 20:05:26 +09:00
KAMADA Ken'ichi 82a6b2ef7e Fix the note on the rename of Tag.value(). 2017-03-27 20:03:28 +09:00
KAMADA Ken'ichi e4ac5ec3f2 Increment the version to 0.2. 2017-03-26 21:30:24 +09:00
KAMADA Ken'ichi 9001103c88 Add compatibility notes in the documentation. 2017-03-26 21:29:33 +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 f11f3c306b Remove parse_image(). 2017-03-24 23:15:24 +09:00
KAMADA Ken'ichi 24b69ed85b Change the return value of Readaer.fields() to a slice. 2017-03-24 23:13:24 +09:00
KAMADA Ken'ichi 81b5efa7aa Cleanup imports and require Rust 1.15. 2017-03-24 23:09:22 +09:00
KAMADA Ken'ichi 5600fb205f Add DateTime parser.
This change introduces a new variant to Error and breaks the API
compatibility.
2017-03-24 22:57:38 +09:00
KAMADA Ken'ichi 7f66863d84 Add Tag.default_value(). 2017-03-24 22:46:26 +09:00
KAMADA Ken'ichi 6a5355750e Add categories in Cargo.toml. 2017-03-22 19:45:38 +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 61d78aa197 Test parsing an unknown field. 2017-03-14 21:53:48 +09:00
KAMADA Ken'ichi 02525d42ed Increment the version to 0.1.3. 2017-03-12 19:36:07 +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 b66b47d1fd More tests on out-of-range accesses around unsafe code. 2017-03-12 19:16:00 +09:00
KAMADA Ken'ichi 4f2e54a6b9 Parse an empty ASCII field into an empty Vec.
The previous behavior was chosen to ensure that value[0] is always
present, but it is inconsistent with that of other fields.
2017-03-12 19:13:21 +09:00
KAMADA Ken'ichi bd5fa39ba9 Clarify the error messages on truncated IFDs. 2017-03-12 19:09:02 +09:00
KAMADA Ken'ichi 8d4d3d4df0 Parse a TIFF image as well as a JPEG in the main example. 2017-03-05 08:19:37 +09:00
KAMADA Ken'ichi ae70e71db6 Update the description of the library. 2017-03-05 08:18:53 +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 3a1630c452 Test the move of Reader with Box. 2017-03-02 22:38:47 +09:00
KAMADA Ken'ichi 9ca277c3e5 Increment the version to 0.1.2. 2017-02-25 22:43:47 +09:00
KAMADA Ken'ichi a8bb533128 Move a platform test into a separate file. 2017-02-24 20:49:57 +09:00
KAMADA Ken'ichi 74cd3435b8 Update the example to use struct Reader instead of parse_image(). 2017-02-24 20:48:38 +09:00