Commit Graph

47 Commits

Author SHA1 Message Date
Michael Pfaff 9a4f4e2af6
Add missing min,max import 2022-03-03 17:20:54 -05:00
Michael Pfaff 6c31e13057
Merge remote-tracking branch 'origin/master' 2022-03-03 17:12:13 -05:00
Michael Pfaff d5df9f6f6d
Reformat tiff.rs and reorder imports and remove unused imports 2022-03-03 07:47:06 -05:00
Michael Pfaff c6d7406b88
Update dependencies and small improvements 2021-10-05 08:00:17 -04:00
KAMADA Ken'ichi 7365bc564f Wrap TIFF parser functions into a struct. 2021-06-05 19:32:24 +09:00
Michael Pfaff b3cf5d9e61
Improve some more 2021-05-29 02:08:22 -04:00
Michael Pfaff a6461ef7d5
Improve 2021-05-28 13:48:05 -04:00
KAMADA Ken'ichi da36010bb9 Update documentation. 2021-03-21 17:56:37 +09:00
KAMADA Ken'ichi 7de2ff0ddd Add more tests on truncated data. 2020-02-22 19:57:17 +09:00
KAMADA Ken'ichi af94ad50b6 Use ? instead of .unwrap() in doctests. 2020-02-01 20:28:21 +09:00
KAMADA Ken'ichi 60c8e15b11 Update the documentation for version 0.5. 2020-01-26 23:12:47 +09:00
KAMADA Ken'ichi 1568e3151f Separate struct Exif from Reader. 2020-01-20 22:05:06 +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 fa34bc9895 Derive Clone trait for Value and Field. 2019-12-15 21:11:20 +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 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 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 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 8b06acb3dd Do not treat IFD2 and beyond as an error; just ignore them. 2018-06-17 21:34:56 +09:00
Kornel 9c45d1903a Replace try!() with ? 2018-04-17 23:21:40 +09:00
KAMADA Ken'ichi d882dce9a0 Update documentation and doc-tests. 2018-01-13 23:33:45 +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 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 73bced6cbf Add an experimental Writer that encodes and writes Exif data. 2017-07-01 19:17:37 +09:00
KAMADA Ken'ichi 8f2ece2b01 Implement std::fmt::Display trait for DateTime. 2017-06-17 21:43:59 +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 61d78aa197 Test parsing an unknown field. 2017-03-14 21:53:48 +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 bd5fa39ba9 Clarify the error messages on truncated IFDs. 2017-03-12 19:09:02 +09:00
KAMADA Ken'ichi b075a27d4e Change Tiff to TIFF in a comment. 2017-01-12 22:01:47 +09:00
KAMADA Ken'ichi 00c369e092 Fix a typo. 2017-01-12 21:52:31 +09:00
KAMADA Ken'ichi 906a25cb31 Add parse_image(), which accepts a JPEG or TIFF image. 2017-01-12 21:51:11 +09:00
KAMADA Ken'ichi 5d9190304f Return the little-endian flag from parse_exif(). 2016-12-17 00:30:46 +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 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 6f9be2c2a9 Return a usize for the unit length from get_type_info(). 2016-11-03 18:51:54 +09:00
KAMADA Ken'ichi 0e9512472c Parse TIFF IFD structure. 2016-10-26 22:46:20 +09:00