Commit Graph

224 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 ff3fb5ba65
Remove unneccessary unsound rustc flag 2022-03-03 07:48:21 -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 5c1446df00
Replace cfg!(debug_assertions) with debug_assert! 2022-03-03 07:46:12 -05:00
Michael Pfaff d10edd35a5
Update time dependency and add Cargo.lock to .gitignore 2022-03-03 07:33:18 -05:00
KAMADA Ken'ichi ab77d18591 Use std::{f32,f64}::MIN to fix regression before Rust 1.43. 2021-12-15 23:21:50 +09:00
sharnoff 6db71de2fc Generate documentation for Tag consts 2021-12-15 23:11:26 +09:00
KAMADA Ken'ichi 86eaa73be0 Simply use debug_assert!() instead of cfg!(debug_assertions). 2021-10-18 23:48:40 +09:00
Michael Pfaff c6d7406b88
Update dependencies and small improvements 2021-10-05 08:00:17 -04:00
KAMADA Ken'ichi d65ccedc22 Link to the NEWS file from rustdoc. 2021-08-01 23:40:11 +09:00
KAMADA Ken'ichi 5b9bc48ba6 Add NEWS file. 2021-08-01 23:39:45 +09: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 8232c6cd51 Deprecate impl From<{Rational,SRational}> for {f64,f32}.
The #[deprecated] attribute does not work on impl items, so
comments have been added.
2021-05-04 22:12:47 +09:00
KAMADA Ken'ichi 8a9e10de60 Add Rational::to_f32 and SRational::to_f32. 2021-05-04 21:54:44 +09:00
KAMADA Ken'ichi 17344addcb Add a test file for little-endian data. 2021-05-04 21:42:26 +09:00
KAMADA Ken'ichi 8f7f8afc35 Remove AnnotatableTryInto and cleanup the uses of TryFrom. 2021-04-03 23:34:25 +09:00
KAMADA Ken'ichi 7de28fa4ae Increment the version to 0.5.4. 2021-03-26 23:44:28 +09:00
KAMADA Ken'ichi da36010bb9 Update documentation. 2021-03-21 17:56:37 +09:00
KAMADA Ken'ichi 117e26a715 Remove the actual version from README. 2021-02-23 22:31:32 +09:00
KAMADA Ken'ichi a2596027c8 Simplify length-specified reads. 2021-02-23 22:20:01 +09:00
KAMADA Ken'ichi 180ac576b7 Add more examples in the crate-level documentation. 2021-02-04 22:38:42 +09:00
KAMADA Ken'ichi 4da1e340fc Move the upgrade guide into a separate module. 2021-01-24 19:40:04 +09:00
KAMADA Ken'ichi 6c08800089 Cleanup buffer length calculation. 2021-01-24 19:38:31 +09:00
KAMADA Ken'ichi 37001e4cba Change an error that should never happen to Option::expect. 2021-01-07 22:49:33 +09:00
KAMADA Ken'ichi a5d8a3e618 Remove an unnecessary return. 2021-01-07 22:24:24 +09:00
KAMADA Ken'ichi 1b05eab57e Merge the fix for an infinite loop in reading PNG files. 2021-01-05 17:55:31 +09:00
KAMADA Ken'ichi 7c643da197 Increment the version to 0.5.3. 2021-01-05 17:49:15 +09:00
KAMADA Ken'ichi f21df24616 Fix an infinite loop in reading PNG files. 2021-01-04 11:06:15 +09:00
KAMADA Ken'ichi f57a972e2d Support Exif in WebP. 2020-12-14 21:12:19 +09:00
KAMADA Ken'ichi ef78b2241b Check the Exif block contents in truncation tests. 2020-12-08 19:35:57 +09:00
KAMADA Ken'ichi a406139859 Remove unnecessary use of Cursor in tests. 2020-12-02 21:48:40 +09:00
KAMADA Ken'ichi 386fb2cc8b Test exif.heic and exif.png in tests/rwrcmp.rs. 2020-11-21 20:01:08 +09:00
KAMADA Ken'ichi 7c113302de ErrorKind::Interrupted should be handled by discard_exact. 2020-09-06 15:23:36 +09:00
KAMADA Ken'ichi 4b18cbfe92 Move discard_exact into BufReadExt trait. 2020-08-12 23:35:00 +09:00
KAMADA Ken'ichi 0807862f0f Increment the version to 0.5.2. 2020-08-07 21:41:30 +09:00
KAMADA Ken'ichi 6e3c37d591 Support Exif in PNG. 2020-08-03 22:57:50 +09:00
KAMADA Ken'ichi b99c21236e Add tags from Design rule for Camera File system: DCF 2.0. 2020-02-29 19:11:48 +09:00
KAMADA Ken'ichi 8a853122ac Call Reader::read_raw from read_from_container. 2020-02-29 19:10:41 +09:00
KAMADA Ken'ichi 3d32b596de Fix a typo. 2020-02-26 21:47:39 +09:00
KAMADA Ken'ichi 7de2ff0ddd Add more tests on truncated data. 2020-02-22 19:57:17 +09:00
KAMADA Ken'ichi 35e2ccc33b Remove duplicate codes to display comma separated values. 2020-02-22 19:56:14 +09:00
KAMADA Ken'ichi 8ee0bc6c83 Increment the version to 0.5.1. 2020-02-15 21:36:41 +09:00
KAMADA Ken'ichi b1dfc310e9 Update documentation and some strings. 2020-02-15 19:17:02 +09:00
KAMADA Ken'ichi 4517a1a771 Distinguish unknown values from reserved ones. 2020-02-15 19:10:54 +09:00
KAMADA Ken'ichi 663a24de79 Try a new API set internally for Value access. 2020-02-15 19:07:58 +09:00
KAMADA Ken'ichi 22395fca25 Handle "unknown" value in BrightnessValue. 2020-02-13 21:06:27 +09:00
KAMADA Ken'ichi 79cc94f615 More readable Debug::fmt for Value::{Ascii, Undefined}. 2020-02-05 23:05:48 +09:00
KAMADA Ken'ichi 04e2cf568c Add constants for the new tags in Exif 2.32. 2020-02-05 23:05:31 +09:00
KAMADA Ken'ichi bc0053a2e7 Use Vec::drain to avoid an extra memory allocation. 2020-02-05 23:05:10 +09:00
KAMADA Ken'ichi af94ad50b6 Use ? instead of .unwrap() in doctests. 2020-02-01 20:28:21 +09:00
KAMADA Ken'ichi 4621acaaab Increment the version to 0.5. 2020-01-26 23:19:54 +09:00
KAMADA Ken'ichi 60c8e15b11 Update the documentation for version 0.5. 2020-01-26 23:12:47 +09:00
KAMADA Ken'ichi 1d683572be Include the container in the Error::NotFound message. 2020-01-26 19:21:18 +09:00
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