Andrew Champion
c5fcba45a0
Fix typo in error display message
2019-12-21 15:57:24 +00:00
HeroicKatora
cbaa9dbc5b
Merge pull request #68 from aschampion/refactors/test-dedup
...
Deduplicate tests and remove tempfile dev-dependency
2019-12-21 16:47:42 +01: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
57783ba43f
Merge pull request #66 from aschampion/features/32-bit
...
Support 32- and 64-bit integer sample grayscale and RGB(A) images
2019-12-19 13:19:35 +00:00
Andrew Champion
abd6aee19f
Remove outdate and ambiguous TODO (minor)
2019-12-16 22:10:57 +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
e5d2e7862c
Parse all homogeneous bit depth RGB(A) color types
...
Make the behavior of RGB and RGBA like Gray in returning ColorTypes for
all homogeneous bit depths, even if those depths are not 8, 16, 32 or
64. Note that this does not change which color types can actually be
decoded.
2019-12-11 15:03:05 +00:00
Andrew Champion
6e61de81b6
Simplify color type matching
2019-12-11 12:56:11 +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
Andrew Champion
1f92c562bc
Support 32-bit rgb and rgba decoding
2019-12-10 20:18:51 +00:00
Andrew Champion
fca4e1f88a
Support 32-bit grayscale decoding
2019-12-10 20:18:23 +00:00
HeroicKatora
ff574b4ca2
Merge pull request #64 from image-rs/release-0.4
...
Document changes for release 0.4
v0.4,0
2019-11-23 19:43:33 +01:00
HeroicKatora
6f87228458
Merge pull request #65 from image-rs/error-type
...
Improve the error types
2019-11-21 19:36:38 +01:00
Andreas Molzer
15929f8b8e
Document changes for release 0.4
...
Fixes : #60
2019-11-21 19:23:03 +01:00
Andreas Molzer
f13492e41d
Fix a doc typo found in PR review
2019-11-21 18:46:55 +01:00
Andreas Molzer
1d9944c5c5
Mark both detailed error types as non-exhaustive
...
This makes it cheaper to introduce new features that might require
amending the list of variants by allowing us to introduce previously
uncovered causes or more specialized representations.
2019-11-20 20:58:45 +01:00
Andreas Molzer
a14b23473b
Export the inflate error publicly
...
It encapsulates the implementation detail of holding a miniz_oxide
status within. The derived traits are not too extensive for other
possible representations as well.
2019-11-20 20:02:55 +01:00
Andreas Molzer
101940335c
Fix public constructor from miniz_oxide status
...
Avoids leaking the dependency on `miniz_oxide` into the public interface
by making a constructor taking a status argument crate internal. It
would otherwise not be possible to replace the deflate decoder without
breaking that interface.
2019-11-20 19:56:13 +01:00
HeroicKatora
8e1c67ee53
Merge pull request #63 from image-rs/tagged
...
Replace FromPrimitive with our own tag macro
2019-11-12 20:14:25 +01:00
Andreas Molzer
7b672998db
Get rid of num-traits crate
...
Turns out the only use was as a private bound which was unused within
that method.
2019-11-12 20:06:02 +01:00
HeroicKatora
62fee106a7
Merge pull request #62 from onnotechno/multipage_image_patch
...
Multipage image patch
2019-11-12 13:13:57 +01:00
Onno Kammeraad
fd789dc420
Cursor::new(Vec::new()) requires a &mut instead of just &
2019-11-12 13:09:09 +01:00
Andreas Molzer
07e8501ad6
Prefer matching over if-else-chain in tags macro
...
Thanks to the review comment for pointing this style issue out.
2019-11-12 10:53:38 +01:00
Onno and HeroicKatora
f70447325e
Update tests/encode_images.rs
...
Co-Authored-By: HeroicKatora <HeroicKatora@users.noreply.github.com >
2019-11-12 10:40:19 +01:00
Onno Kammeraad
b2eb480c44
add multipage testcase, to validate the multipage image handling
2019-11-12 09:44:27 +01:00
Onno Kammeraad
686e9b2648
added a missing offset increase while adding padding
2019-11-11 16:15:01 +01:00
Andreas Molzer
517638a38f
Prefer explicit conversion over as
...
The discriminant of some enum types can be retrieved with the `as`
operator and in C style enums it is also possible to set a specific
discriminant. However, that may silently change—breaking the value
written to the file. It is better to use that technique mostly for ffi
purposes.
2019-11-10 23:20:19 +01:00
Andreas Molzer
a6696ab02f
fixup! Move everything to the tags macro
2019-11-10 19:24:22 +01:00
Andreas Molzer
258edf4a46
Remove the num-derive dependency
2019-11-10 18:02:43 +01:00
Andreas Molzer
f88c9f00c3
Move everything to the tags macro
2019-11-10 18:02:42 +01:00
Andreas Molzer
f80f4a06d5
Make the Unknown field optional
...
Several other uses that currently rely on num-traits for conversion have
no Unknown representation. Thus, the converter now outputs only known
variants or an error and the exposing function then can put the error
value into an Unknown variant instead.
2019-11-10 18:02:08 +01:00
Onno Kammeraad
cbae42ea94
fixed support for multipage images, the IDF offset is added during the new and also at the end of the internal_finish. This should only be done once
2019-11-06 14:04:18 +01:00
Onno Kammeraad
80b8ec5cdb
Somehow the current offset was invalid when using multipage images. Now using the seek function to get the current offset
2019-11-06 13:58:29 +01:00
Andreas Molzer
ffdeb62b9f
Rework the tag macro to make it reusable
...
Factor out parts that are unique to instantiations such as the name, the
documentation, the underlying type, the public conversion methods.
Also adds the ability to document individual items and remodels the
syntax to more closely resemble ordinary enum definitions.
2019-11-01 01:35:18 +01:00
HeroicKatora
6aea7b33c1
Merge pull request #49 from Masterchef365/deflate
...
Old-style DEFLATE compression support
2019-11-01 00:42:18 +01:00
HeroicKatora
770262cb02
Merge pull request #25 from birktj/new_tests
...
Test decoder output
2019-10-15 04:35:06 +02:00
HeroicKatora
1f957029af
Merge pull request #55 from trolleyman/master
...
Make Limits struct fields publicly accessible
2019-10-14 21:07:11 +02:00
Masterchef365
f8d4b57120
Change implementation details for InflateError, add uncompressed cap
2019-10-04 18:52:39 -07:00
Masterchef365
6f9f2adfbf
Improved error messages for inflate decompression
2019-10-02 21:06:11 -07:00
Masterchef365
205626bd62
Switch to miniz_oxide crate for DEFLATE decompression
2019-10-02 18:51:47 -07:00
Masterchef365
ce73d39d57
Add old-style DEFLATE support
2019-10-02 18:51:07 -07:00
Masterchef365
b79128d766
Add Deflate and OldDeflate compression type recognition
2019-10-02 18:51:07 -07:00
HeroicKatora
c8f384d6a6
Merge pull request #58 from paolobarbolini/update-num-derive
...
update num-derive to 0.3, bump rustc to 1.34.2
2019-10-01 21:01:21 +02:00
Paolo Barbolini
ce1d4cb289
update num-derive to 0.3 change minimal rustc to 1.34.2
2019-10-01 20:31:43 +02:00
HeroicKatora
b95e5b8f95
Merge pull request #56 from trolleyman/invalid_test_names
...
Renamed test files
2019-09-22 23:43:51 +02:00