Commit Graph

168 Commits

Author SHA1 Message Date
KAMADA Ken'ichi eec3791e10 Remove Error::description that has been soft-deprecated. 2020-01-26 19:20:12 +09:00
KAMADA Ken'ichi 904f4b577e Limit the size of Exif data. 2020-01-26 19:19:50 +09:00
KAMADA Ken'ichi d6746c4004 Change the error message when no brand is recognized. 2020-01-23 23:55:30 +09:00
KAMADA Ken'ichi bd2602240a Fix a stale doc comment on Exif::fields. 2020-01-23 23:54:35 +09:00
KAMADA Ken'ichi 6b461fd87a Detect HEIF using the compatible brands. 2020-01-22 21:24:29 +09:00
KAMADA Ken'ichi a49d2562d8 Accept HEIF image sequence files. 2020-01-21 21:41:21 +09:00
KAMADA Ken'ichi 1568e3151f Separate struct Exif from Reader. 2020-01-20 22:05:06 +09:00
KAMADA Ken'ichi ffabb8adc2 Remove stale comments. 2020-01-20 22:04:32 +09:00
KAMADA Ken'ichi ad07ca1699 Merge HEIF support. 2020-01-20 22:02:26 +09:00
KAMADA Ken'ichi 5219996fa4 Add Reader::read_from_container. 2020-01-19 20:58:01 +09:00
KAMADA Ken'ichi 0e398cd63a Support reading the Exif data from the HEIF container. 2020-01-19 20:48:04 +09:00
KAMADA Ken'ichi faefc75601 Use iter() instead of into_iter() where appropriate. 2020-01-08 22:52:44 +09:00
KAMADA Ken'ichi 3c928122eb Increment the version to 0.4. 2019-12-22 22:28:48 +09:00
KAMADA Ken'ichi 3e8ed54497 Update the documents for version 0.4. 2019-12-22 22:20:49 +09:00
KAMADA Ken'ichi 5d5d995907 Remove a lifetime parameter that is no longer needed. 2019-12-22 21:08:20 +09:00
KAMADA Ken'ichi f90f5d885a Mark enum Context and Error as non_exhaustive. 2019-12-22 20:33:56 +09:00
KAMADA Ken'ichi 9e4c996cdf Require Rust 1.40. 2019-12-22 20:33:18 +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 47ab7e4764 Restore Reader::fields to list all fields including duplicates. 2019-12-22 20:28:25 +09:00
KAMADA Ken'ichi fa34bc9895 Derive Clone trait for Value and Field. 2019-12-15 21:11:20 +09:00
KAMADA Ken'ichi 90bf02c02b Merge: Rework the lifetimes and the APIs.
Value and Field no longer borrow the raw buffer.  Reader no longer
cheats the borrow checker to manage fields in both a Vec and a HashMap,
and Reader::fields returns an iterator instead of a slice (of the Vec).
2019-12-15 21:06:18 +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 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