HeroicKatora
ef004cee48
Merge pull request #108 from image-rs/short-read-in-lzw
...
Fix lzw decoding stopping short of full decode
2020-12-06 02:52:06 +01:00
Andreas Molzer
6d7d92c605
Adjust field names based on review
2020-12-06 02:34:59 +01:00
Andreas Molzer
0c06d32ee4
Add a constant unlimited limit
2020-12-05 18:20:23 +01:00
Andreas Molzer
4d8c64bf1e
Fix lzw decoding stopping short of full decode
...
When the required amount of data was just a tiny bit larger than full a
page size (one buffer increment), the decoder would stop since all
compressed data had been read. However, the lzw decoder contains a small
internal bit buffer for code decoding. That is, some remaining bytes had
been retained and were still left to be decoded.
2020-12-05 14:57:28 +01:00
ruffson
e2caf86f6a
Add intos for Short
2020-11-16 19:01:18 +01:00
ruffson
9f4799912f
Remove geokey parsing
2020-11-16 18:57:48 +01:00
ruffson
4b218be4ac
Add geodir hashmap to decoder
2020-11-16 18:57:24 +01:00
ruffson
96d6d52830
Move geo code in its own dir
2020-11-16 18:57:24 +01:00
ruffson
62a1a500a5
Add support for GeoTiff geokey dir
2020-11-16 18:57:21 +01:00
ruffson
3953bd31e1
Read out short vecs and ascii from ifds
2020-11-16 18:52:04 +01:00
HeroicKatora
83004c8344
Merge pull request #104 from image-rs/edition2018
...
Convert to edition 2018
2020-10-31 20:31:03 +01:00
Andreas Molzer
8ab9d30eff
Convert to edition 2018
...
Notably, This enables NLL even on older compilers such as 1.34.
2020-10-31 20:13:30 +01:00
Andreas Molzer
ed22865f04
Remove unused and incorrect Wrapping impl
...
This is used in the predictor and should be reversible but for floating
point the simply addition is not. It should instead be some variant of
byte casting but it hasn't been implemented yet.
2020-10-11 15:09:46 +02:00
ruffson
6281360f10
Fix error case
2020-09-26 18:45:58 +02:00
ruffson
d00ab0cc61
Fix formatting
2020-09-26 17:22:59 +02:00
ruffson
7c4ee96aee
Check for size when reading strip bytes
2020-09-26 16:50:51 +02:00
ruffson
cb5319c426
Deal with empty jpeg_tables
2020-09-26 14:35:06 +02:00
ruffson
cb900819d9
Remove tile processing and add error handling
...
I removed the code that checked the tile attributes. Because I would
rather later on PR something that works than a half-baked solution.
2020-09-26 14:07:27 +02:00
ruffson
35ea719d9e
Remove get_all_tags()
2020-09-26 13:44:53 +02:00
ruffson
5fd0534ea2
Fix error handling
2020-09-26 12:23:40 +02:00
ruffson
72474b569e
Add byte expected error and cleanup
2020-09-25 20:06:52 +02:00
ruffson
46918b395c
Condense tile and strip reading code
2020-09-25 19:47:35 +02:00
ruffson
a510b03e1c
Apply auto-format to modified files
2020-09-25 19:47:33 +02:00
ruffson
2cb57a4d04
Add initial support for modern JPEG compression
...
Some things still need to be done:
- Check RGB images
- Check small images
- Check huffman-only jpeg tables
- Check empty jpeg tables
- Add tests
2020-09-25 19:42:29 +02:00
ruffson
da9bdac8a2
Read out byte-sized arrays
2020-09-25 19:39:09 +02:00
Andreas Molzer
7b41c823e9
Some slight manual touch up where style was bad
2020-09-12 01:15:45 +02:00
Andreas Molzer
bf24b3f935
Do a clippy pass
2020-09-12 01:15:08 +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
Andreas Molzer
d8bfa84d06
Add notes for unsupported predictors
2020-08-31 19:53:06 +02:00
Etienne Prothon
200355d3bc
Mark decoding buffer f32 and f64 as unimplemented
2020-08-17 18:32:43 +02:00
Etienne Prothon
768e0d4af7
feat: Add tag to single f32 or f64
2020-08-05 15:34:28 +02:00
Etienne Prothon
3b0da4d1ae
feat: Add decoding value and get tags as f32 or f64
2020-08-05 14:25:02 +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
Etienne Prothon
ba3f6e604a
feat: Add BigTiff enum values
2020-07-27 10:52:43 +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
Etienne Prothon
9f4873bae8
fix: Read ascii encoded in offset
2020-07-15 16:21:09 +02:00
Andrew Champion
71f3aa8b15
Include unknown variant for sample format
...
Since it is known that libtiff produces other sample format variants we
do not support, represent these as variants. This also allows returning
the sample formats in errors so that composition of formats and known
and unknown formats are clearly reported.
2020-02-10 13:21:16 +00:00
Andrew Champion
d79d8c3353
Make sample format FIXME a TODO (minor)
2020-02-10 13:21:16 +00:00
Andrew Champion
ae4ae9c36e
Fix capitalization case of sample format enum
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
a439baa948
Decoder: remove test make wrong assumption
...
The byte count for strips is the compressed length. The compressed
length may be larger than the uncompressed length, especially with poor
compression choices (multi-byte samples with packbits) or small images.
2020-02-09 18:37:16 +00:00
Andrew Champion
6e23274bea
Decoder: max uncompressed length for LZW must respect buffer byte length
...
Fixes #69 .
2020-02-09 18:24:22 +00:00
Andrew Champion
bbc49291e4
Add support for IEEEFP Gray(32) decoding
2020-02-06 18:40:41 +00:00
Andrew Champion
ec0477125f
Tags: restore primitive conversions as inherent methods
2020-02-01 18:25:05 +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