Commit Graph
80 Commits
Author SHA1 Message Date
5225225 03b6ed413b Fix out of bounds subtraction with invalid JPEG table 2021-05-29 22:12:35 +01:00
5225225 5b7814c994 Check for OOM when creating LZWReader 2021-05-29 22:12:35 +01:00
5225225 a15d619471 Fix OOM in Jpeg decoding buffer allocation 2021-05-29 22:12:35 +01:00
5225225 2bb37a4ecd Do checked multiplication for samples per strip 2021-05-29 12:37:15 +01:00
5225225 b41ac105ab Use checked multiplication when calculating buffer size 2021-05-29 12:36:59 +01:00
5225225 1e10b9803b Add check for an invalid strip count 2021-05-29 12:36:50 +01:00
5225225 2f4e491874 Check for where tag count * tag size overflows 2021-05-28 20:32:30 +01:00
5225225 bdfe2f55fd Check error returned from parsing invalid image 2021-05-28 15:46:55 +01:00
5225225 eda5a8ac30 Fix division by zero issue with malformed file 2021-05-28 14:44:50 +01:00
Tomáš Král b9590e0842 remove WhiteIsZero i8 test 2021-05-15 18:15:24 +02:00
Tomáš Král 00e0eb9006 incremental tile decoding, refactoring 2021-04-12 15:09:39 +02:00
Tomáš Král ebd0e266f7 Merge remote-tracking branch 'upstream/master' into tiles 2021-04-12 14:52:38 +02:00
Philipp Oppermann 47dfa0aa3e Merge branch 'master' into encode-bigtiff 2021-04-12 11:34:41 +02:00
Tomáš Král fddc048849 changed test photos to avoid coyright, added whiteiszero test 2021-04-06 13:58:33 +02:00
Tomáš Král b2a7e35c85 added basic tiled-based decoding 2021-04-04 18:15:28 +02:00
Philipp Oppermann d4c958f915 Add a test for bigtiff encoding 2021-03-23 14:29:56 +01:00
Kal Conley d086e289dd Implement missing tag types and signed 64-bit support 2021-03-17 01:24:32 +01:00
HagaiHargil cd2f4f6462 Added tests and finalized i8 support 2020-12-13 12:00:48 +02:00
HagaiHargil 7ec2b75c70 Added int16 tests 2020-12-08 13:42:08 +02:00
Robert Wassens 5346a441ae Processed review comment 2020-12-07 11:43:09 +01:00
Robert Wassens 76173069a3 round trip test 2020-12-06 23:34:24 +01:00
Robert Wassens 7da8f01f75 make strip size configurable 2020-12-05 01:39:37 +01:00
Andreas Molzer bf24b3f935 Do a clippy pass 2020-09-12 01:15:08 +02:00
Andreas Molzer 2b12c1b162 Rewrite tests to be less repetitive 2020-09-12 01:13:09 +02:00
Andreas Molzer e48691ca32 Add decoding benchmarks 2020-09-05 21:57:51 +02:00
Andreas Molzer 44c75a66ab Merge remote-tracking branch 'origin/master' into features/32-bit-float-samples 2020-08-31 20:50:16 +02:00
Etienne Prothon 5f48444fa0 Merge branch 'master' of github.com:Farkal/image-tiff into features/32-bit-float-samples 2020-08-04 16:43:01 +02:00
Etienne Prothon b2da2f2333 Merge branch 'master' of github.com:Farkal/image-tiff into big-tiff 2020-07-27 12:01:55 +02:00
Farkal ba1daa18b2 Allow custom encoding process (#84)
Simplify encoding of tags
2020-07-27 11:29:09 +02:00
Etienne Prothon dacc2864e8 feat: better compatibility with old api 2020-07-24 01:22:33 +02:00
Etienne Prothon 797e3dca07 fix: Big tiff decoding and add tests 2020-07-24 00:47:14 +02:00
Etienne Prothon 23751bd8c5 feat: Support decoding big tiff 2020-07-23 01:33:41 +02:00
Andrew Champion 8d4bdce7aa Add support for IEEEFP 32 and 64 bit encoding 2020-02-10 13:21:16 +00:00
Andrew Champion c2084835fa Add support for IEEEFP Gray/RGB/RGBA/CMYK(64) decoding 2020-02-10 13:21:16 +00:00
Andrew Champion 97c888f166 Add support for IEEEFP RGB/RGBA/CMYK(32) decoding 2020-02-10 13:21:13 +00:00
Andrew Champion 24d347ecf5 Tests: add regression test for issue 69 2020-02-09 18:37:16 +00:00
Andrew Champion bbc49291e4 Add support for IEEEFP Gray(32) decoding 2020-02-06 18:40:41 +00:00
Andrew Champion 42c94ac3d9 Add support for CMYK(16|32|64) encoding 2019-12-21 15:57:24 +00:00
Andrew Champion eadec8f0b9 Remove most unchecked size/index casts
Convert most unchecked size/index `as` casts to checked casts with
`TryFrom`, included another top-level error variant.

This has several motivations:
- Making the library as robust as possible, including to platform
differences.
- Unchecked casts are susceptible to breakage during refactorings.
- Preparing for BigTIFF support, which will require the introduction of
generics and associated types for some parts of the de/encoders.
Unchecked primitive casts cannot be bound, while TryFrom can, and
overflowing conversions become more likely.
- Remaining u16 casts may be prone in failure in existing practice and
not just in theory during future changes.
2019-12-21 15:57:24 +00:00
Andrew Champion 462697e373 Add support for CMYK(16|32|64) decoding 2019-12-21 15:57:24 +00:00
Andrew Champion c537f5cc64 Add decode test for CMYK(8) 2019-12-21 15:57:24 +00:00
Andrew Champion f92be13f6c Factor tags into own module
Tag representations are not decoder- or encoder-specific, so should live
in their own module accessible to both for reuse. The decoder::ifd
module remains since this module is mainly dedicated to decoding the
IFD.
2019-12-21 15:57:24 +00:00
Andrew Champion 959254aee9 Deduplicate encoding tests
Also removes dev dependency on tempfile.
2019-12-21 15:12:25 +00:00
Andrew Champion 3f14098060 Deduplicate decoding tests 2019-12-21 15:11:47 +00:00
Andrew Champion c72a8d364d Add tests for exotic 12-bit sample images
These images should correctly report their color depths, but fail to
decode as they are unsupported.
2019-12-16 18:53:44 +00:00
Andrew Champion 8c4cea5d97 Support 64-bit encoding
Note that this adds the LONG8 data type from BigTIFF because of bounds
requiring TiffValue. However, this datatype should not actually be
written to tags.
2019-12-10 20:18:53 +00:00
Andrew Champion 0c53e1066a Support 64-bit rgb and rgba decoding 2019-12-10 20:18:53 +00:00
Andrew Champion f4e985e0bd Support 64-bit grayscale decoding 2019-12-10 20:18:53 +00:00
Andrew Champion af010edcfd Support 32-bit encoding 2019-12-10 20:18:53 +00:00
Andrew Champion f32b3b9d10 Fix warnings in encoding test 2019-12-10 20:18:53 +00:00