Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from image-rs:master #3

Open
wants to merge 402 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
402 commits
Select commit Hold shift + click to select a range
2cba04d
Merge pull request #118 from satarsa/master
fintelia Feb 24, 2021
d086e28
Implement missing tag types and signed 64-bit support
kalcutter Mar 16, 2021
09aa28d
Replace Travis badge with GitHub Actions
atouchet Mar 19, 2021
53d0256
Merge pull request #120 from atouchet/ga
HeroicKatora Mar 19, 2021
f575415
Modified the validation for ascii tag type
emmanuelantony2000 Mar 20, 2021
6fe9b78
Merge pull request #121 from emmanuelantony2000/ascii_tag_validation
HeroicKatora Mar 20, 2021
745ed62
Change associated const types of TiffValue to usize/u8
phil-opp Mar 23, 2021
4cfed1c
Make encoders generic to support BigTiff too
phil-opp Mar 23, 2021
dc04282
Fix: Use the correctly parametrized directory and image encoder types
phil-opp Mar 23, 2021
d4c958f
Add a test for bigtiff encoding
phil-opp Mar 23, 2021
9021985
Provide documentation for TiffKind helper trait
phil-opp Mar 23, 2021
29a020e
Clarify TODO
phil-opp Mar 23, 2021
ce1ee67
Move `TiffValue` trait to separate module
phil-opp Mar 24, 2021
0ac444b
Improve documentation
phil-opp Mar 24, 2021
59d0b73
Run rustfmt
phil-opp Mar 24, 2021
8fcacc8
Merge pull request #119 from kalcutter/missing-tags-and-i64
HeroicKatora Mar 24, 2021
5ca2730
Add `SMinSampleValue` and `SMaxSampleValue` tags
kalcutter Apr 3, 2021
91fe529
Merge pull request #123 from kalcutter/add-s-minmax-samplevalue-tags
HeroicKatora Apr 3, 2021
b2a7e35
added basic tiled-based decoding
Apr 4, 2021
68f2182
fixed WhiteIsZero processing
Apr 4, 2021
fddc048
changed test photos to avoid coyright, added whiteiszero test
Apr 6, 2021
65a1c55
TileAttributes doc comments, padding buffer limit check
Apr 6, 2021
60c6e0c
Simplify de-compression logic
fintelia Apr 10, 2021
7641dcb
Refactoring to simplify expand_strip function
fintelia Apr 10, 2021
201b95f
Improve `expand_strip` and remove `read_{u16, u32, ...}_into`
fintelia Apr 11, 2021
1eb9c4f
fix borrow check issue on rustc 1.34.2
fintelia Apr 11, 2021
47dfa0a
Merge branch 'master' into encode-bigtiff
phil-opp Apr 12, 2021
9b94e9d
Merge pull request #122 from phil-opp/encode-bigtiff
HeroicKatora Apr 12, 2021
ebd0e26
Merge remote-tracking branch 'upstream/master' into tiles
Apr 12, 2021
00e0eb9
incremental tile decoding, refactoring
Apr 12, 2021
69c34ac
Merge pull request #128 from fintelia/simplify-expand3
HeroicKatora Apr 12, 2021
a43aa1f
Merge pull request #126 from fintelia/better-decompress
HeroicKatora Apr 12, 2021
d4ce174
Merge remote-tracking branch 'upstream/master' into tiles
Apr 14, 2021
a874b9c
Merge pull request #125 from TomasKralCZ/tiles
HeroicKatora Apr 18, 2021
a6fb855
Improve deflate support
RReverser May 8, 2021
e70121e
Merge pull request #132 from RReverser/deflate-improvements
fintelia May 14, 2021
521b58d
expand_strip and expand_tile cleanup
May 15, 2021
b9590e0
remove WhiteIsZero i8 test
May 15, 2021
65832e0
Merge branch 'master' into inversion
May 15, 2021
46c7efd
remove unneeded mutability
May 15, 2021
d0e4f37
implement subrange for DecodingBuffer
May 15, 2021
371a9b5
fix u64::MAX error on older compilers
May 15, 2021
b7e8f21
Remove InflateError
RReverser May 15, 2021
9fe9b2e
Merge pull request #134 from RReverser/remove-inflate-error
fintelia May 15, 2021
b7c4f66
remove redundant subrange and outdated comments
May 16, 2021
4dc7c2a
add comment in expand_strip()
May 18, 2021
4df2601
Merge pull request #133 from TomasKralCZ/inversion
HeroicKatora May 18, 2021
ad0f752
remove padding_buffer
May 21, 2021
e44b98d
Prepare 0.7.0 release
phil-opp Apr 21, 2021
150ff83
Add changes of #132 and #134
phil-opp May 16, 2021
e8bc935
Mention changed interpretation of MinIsWhite
HeroicKatora May 25, 2021
bd1e37d
Merge pull request #130 from phil-opp/release
HeroicKatora May 25, 2021
eda5a8a
Fix division by zero issue with malformed file
5225225 May 28, 2021
bdfe2f5
Check error returned from parsing invalid image
5225225 May 28, 2021
285b881
Merge pull request #138 from 5225225/divide_by_zero
HeroicKatora May 28, 2021
2f4e491
Check for where tag count * tag size overflows
5225225 May 28, 2021
1e10b98
Add check for an invalid strip count
5225225 May 29, 2021
b41ac10
Use checked multiplication when calculating buffer size
5225225 May 29, 2021
2bb37a4
Do checked multiplication for samples per strip
5225225 May 29, 2021
3bf1982
Merge pull request #139 from 5225225/value-bytes-overflow
HeroicKatora May 29, 2021
4206679
Add fuzzer with 1MB size limits decoding image
5225225 May 29, 2021
153ed48
Merge pull request #136 from TomasKralCZ/padding_skip
HeroicKatora May 29, 2021
2f6ad07
Try to read multiple images in fuzzer
5225225 May 29, 2021
458a713
Merge pull request #140 from 5225225/fuzzer
HeroicKatora May 29, 2021
a15d619
Fix OOM in Jpeg decoding buffer allocation
5225225 May 29, 2021
5b7814c
Check for OOM when creating LZWReader
5225225 May 29, 2021
03b6ed4
Fix out of bounds subtraction with invalid JPEG table
5225225 May 29, 2021
65a1fbe
Test for short JPEG tag
5225225 May 29, 2021
f0666ae
Fix overflow when calculating strip height for multiple images
5225225 May 29, 2021
3e5f977
Do not carry tag values from previous images
Christopher22 Jun 14, 2021
e92cf21
Fix the mandrill.tiff regression (#145)
Jun 17, 2021
be0619d
Support encoding signed integer formats
fintelia Jun 20, 2021
f2fec92
Merge pull request #146 from fintelia/encode-signed-int
fintelia Jun 20, 2021
1774b36
x
5225225 Jul 15, 2021
b318481
Merge pull request #143 from Christopher22/reset_tag_values
fintelia Aug 15, 2021
2c9e02d
Merge remote-tracking branch 'origin/master' into oom
5225225 Sep 6, 2021
885d762
Implement cycle checking in IFD offsets
5225225 Sep 8, 2021
1c5800d
Infinitely try to read off images rather than only trying 128
5225225 Sep 18, 2021
b065539
Add fuzzing instructions to readme, bump CI version to 1.48
5225225 Sep 18, 2021
7328548
Merge pull request #141 from 5225225/oom
HeroicKatora Sep 18, 2021
a4878e9
Release notes for 0.7.1
HeroicKatora Sep 21, 2021
26e760e
Add notes on MSRV
HeroicKatora Sep 21, 2021
b8459f4
Add fuzzing work and bugs to release notes
HeroicKatora Sep 21, 2021
d7d63e6
Merge pull request #149 from image-rs/release-0.7.1
HeroicKatora Sep 22, 2021
99b2aa9
Add TIFF compression and corresponding tests
Christopher22 Dec 21, 2021
bc7be68
Simplify tests
Christopher22 Dec 22, 2021
30bf508
Avoid allocations
Christopher22 Dec 22, 2021
de95ac3
Remove "CompressionError"
Christopher22 Dec 22, 2021
d6c42dd
Some refactoring of strip/tile decoding
fintelia Dec 22, 2021
3242d32
Reformat
fintelia Dec 22, 2021
fb4c119
Merge pull request #152 from fintelia/refactor-decode
fintelia Jan 6, 2022
9f1e3d7
moved compression into TiffWriter
Pretorer Jan 10, 2022
1d8cbbc
add Packbits compression
Pretorer Jan 10, 2022
37cfcf8
Merge pull request #151 from mindQ-GmbH-Co-KG/compression-release
HeroicKatora Jan 10, 2022
9df18a1
fixed deflate and packbits
Pretorer Jan 11, 2022
6f89033
moved namespace qualifier
Pretorer Jan 11, 2022
77f15b5
Merge pull request #153 from mindQ-GmbH-Co-KG/compression-release
HeroicKatora Jan 11, 2022
e9aa39d
Initialize Decoder in new instead of init
fintelia Jan 6, 2022
31da673
More refactoring
fintelia Jan 7, 2022
dc95ce1
Remove some extremely brittle tests
fintelia Jan 7, 2022
a19d352
Read predictor ahead of time
fintelia Jan 7, 2022
4c942ca
Read JPEGTables ahead of time
fintelia Jan 7, 2022
2d572c0
Remove Decoder::byte_order
fintelia Jan 7, 2022
23fe194
Remove read_ifd_offset_nonrepeating
fintelia Jan 7, 2022
2d10cff
Reading fields shouldn't need the entire Decoder
fintelia Jan 7, 2022
63e6ef8
Add current_chunk to replace strip_index and current_tile
fintelia Jan 7, 2022
a36cd6b
chunk_{offsets,bytes} to replace {tile,strip}_{offsets,bytes}
fintelia Jan 7, 2022
6ba5553
Compute tile attributes on demand
fintelia Jan 7, 2022
b385a6e
Move some decoder fields into a new Image struct
fintelia Jan 7, 2022
4708029
Move image loading to Image::from_reader
fintelia Jan 7, 2022
720e658
Make read_ifd and read_entry stateless
fintelia Jan 8, 2022
7a7d4f0
Avoid unused warning
fintelia Jan 8, 2022
bc20552
Add consistency check between StripOffsets and StripByteCounts
fintelia Jan 8, 2022
593479e
Avoid reading tags in read_jpeg
fintelia Jan 8, 2022
01df985
Fix formatting
fintelia Jan 13, 2022
2c7c889
Remove use half-open range pattern which is unstable on rustc 1.48
fintelia Jan 13, 2022
ca56836
Add back fuzzer generated testcases
fintelia Jan 15, 2022
a780da0
Merge pull request #154 from fintelia/decoder-refactor
fintelia Jan 15, 2022
fa0d6eb
Update jpeg-decoder to 0.2.1
Aaron1011 Feb 9, 2022
7cdfd15
Merge pull request #155 from Aaron1011/update/jpeg-decoder
fintelia Feb 9, 2022
ef7592c
Add changelog and metadata for 0.7.2
HeroicKatora Apr 11, 2022
3399f93
Merge pull request #158 from image-rs/release-0.7.2
HeroicKatora Apr 11, 2022
9394f6d
Make LZWReader incrementally decompress input
fintelia Apr 15, 2022
e4eac36
Remove now unneeded limit check
fintelia Apr 15, 2022
1063d6d
Have LZWReader internally use a BufReader<Take<R>>
fintelia Apr 15, 2022
c910ef8
Remove redundant limit on LZWReader output length
fintelia Apr 15, 2022
4097bf3
Rename test oom_2 -> fuzzer_testcase4
fintelia Apr 15, 2022
ff33343
Fix formatting
fintelia Apr 15, 2022
167088b
Merge pull request #159 from fintelia/stream-lzw
HeroicKatora Apr 15, 2022
7881291
Make PackBitsReader incrementally decompress output
fintelia Apr 15, 2022
b286457
Remove dbg! print
fintelia Apr 16, 2022
4f46bac
Fixes to PackBitsReader
fintelia Apr 16, 2022
9f2508e
Merge pull request #160 from fintelia/stream-pack-bits
HeroicKatora Apr 16, 2022
5924052
Added ability to decompress tiled jpeg files
AlanRace Apr 27, 2022
eeb79ee
Reduce number of clones when processing jpeg data
AlanRace Apr 27, 2022
2cf33d6
Clean up `read_image`
AlanRace Apr 27, 2022
8fcf49d
Added ability to select which tile to load (based on index)
AlanRace Apr 27, 2022
436cfaf
Added ability to select which image (IFD) to load
AlanRace Apr 27, 2022
b196d19
Now using the list of offsets to know how many IFDs we have seen
AlanRace Apr 27, 2022
9e6f977
Updated create_reader to only require &mut SmartReader and not &mut Self
AlanRace Apr 28, 2022
623a3d9
Avoid cloning jpeg_tables and instead pass Arc<Vec<u8>>
AlanRace Apr 30, 2022
ce00bb5
Removed old code
AlanRace Apr 30, 2022
a133056
Removed passing of PhotometricInterpretation to `create_reader`
AlanRace Apr 30, 2022
d437c27
Merge pull request #162 from AlanRace/tiled-jpeg
fintelia May 2, 2022
902f945
Merge branch 'tiled-jpeg' into access-tile
AlanRace May 2, 2022
f809d7d
Fixed compilation issue after merging
AlanRace May 2, 2022
4ce3c2f
`read_tile` now returns `ChunkInfo`
AlanRace May 2, 2022
8f34748
Mirrored return value of `read_tile` to `read_strip`
AlanRace May 2, 2022
dd8c9e4
Added functionality for loading selected strip
AlanRace May 2, 2022
f25530a
Unify expand_strip and expand_tile
fintelia Apr 14, 2022
dc8311f
Merge read_tiled_image and read_stripped_image
fintelia Apr 16, 2022
805a1e5
Rename chunk_byte_range method
fintelia Apr 23, 2022
697d287
Cargo fmt
fintelia May 3, 2022
1f501b5
Reverted `read_strip` and `read_tile` to previous call signature
AlanRace May 3, 2022
72ca636
Added comments for `read_tile`, `read_strip` and `read_*_at`
AlanRace May 3, 2022
68d677d
Merge pull request #164 from fintelia/unify-strip-tile
HeroicKatora May 5, 2022
6efa89c
Added ability to select which tile to load (based on index)
AlanRace Apr 27, 2022
56c20c2
Added ability to select which image (IFD) to load
AlanRace Apr 27, 2022
d8520bd
Now using the list of offsets to know how many IFDs we have seen
AlanRace Apr 27, 2022
6d4c4a4
`read_tile` now returns `ChunkInfo`
AlanRace May 2, 2022
ca4da33
Mirrored return value of `read_tile` to `read_strip`
AlanRace May 2, 2022
e57ca1a
Added functionality for loading selected strip
AlanRace May 2, 2022
6bec36a
Reverted `read_strip` and `read_tile` to previous call signature
AlanRace May 3, 2022
54664d5
Added comments for `read_tile`, `read_strip` and `read_*_at`
AlanRace May 3, 2022
0447d81
Updated to use new unified chunk handling
AlanRace May 9, 2022
8bd02ac
Merge remote-tracking branch 'origin/access-tile' into access-tile
AlanRace May 9, 2022
6e398ce
Remove ChunkInfo from mod.rs that was added through merge
AlanRace May 9, 2022
8a6e93f
Merge fix_endianness and rev_hpredict methods
fintelia Jun 23, 2022
8e5c5b4
Support floating point predictor (predictor 3)
fintelia Jun 23, 2022
5e7702a
Suggested edits
fintelia Jun 27, 2022
3c42a6e
Merge pull request #165 from fintelia/improve-predictor
fintelia Jun 27, 2022
d5e3f4a
Merge remote-tracking branch 'image-tiff/master' into access-tile
AlanRace Jul 7, 2022
8c0c13f
Added `read_chunk_at` and `read_chunk_to_buffer` functions
AlanRace Jul 7, 2022
e1f4161
Removed unused functions and make InvalidChunkIndex a UsageError
AlanRace Jul 8, 2022
5cadbff
Changed to use `u32` for chunk_index
AlanRace Jul 11, 2022
802949f
Removed `ChunkInfo` and added additional functions on decoder
AlanRace Jul 18, 2022
723ef64
Update src/decoder/mod.rs
fintelia Jul 19, 2022
7c4a6fa
Update src/decoder/mod.rs
fintelia Jul 19, 2022
5003803
cargo fmt
fintelia Jul 23, 2022
80e7c46
Merge pull request #163 from AlanRace/access-tile
fintelia Jul 23, 2022
2ec1ab7
Add changelog and metadata for 0.7.3 (#167)
fintelia Jul 24, 2022
d32adf8
Handle possible JPEG decoder errors
val-ms Sep 2, 2022
bd23428
Validate that images contain the proper number of strips (#174)
fintelia Sep 4, 2022
361578d
Fix some warnings
fintelia Sep 4, 2022
0311402
Merge pull request #177 from fintelia/fix-warnings
HeroicKatora Sep 5, 2022
ef3294d
Return an error for zero-size images
fintelia Sep 4, 2022
945a02d
Format
fintelia Sep 4, 2022
fc0dafc
Change error kind
fintelia Sep 5, 2022
907bbee
cargo fmt
fintelia Sep 5, 2022
3bce927
Merge pull request #176 from fintelia/zero-size
fintelia Sep 5, 2022
b0b99fc
Merge pull request #173 from micahsnyder/issue-168-handle-jpeg-decode…
HeroicKatora Sep 6, 2022
5a809a7
Update link to the TIFF specification
luksab Oct 14, 2022
ee27553
Merge pull request #180 from luksab/patch-1
HeroicKatora Oct 14, 2022
d38b65e
Changelog for 0.7.4
HeroicKatora Oct 28, 2022
b877702
Merge pull request #185 from image-rs/release-0.7.4
HeroicKatora Oct 29, 2022
30640d5
Bump jpeg-decoder version pin to 0.3.0
val-ms Nov 2, 2022
b5a78fb
CI: Correct the MSRV from 1.48 to 1.61
val-ms Nov 2, 2022
87d652a
Merge pull request #186 from micahsnyder/bump-jpeg-decoder-dependency
HeroicKatora Nov 3, 2022
1416af1
Remove deprecated methods on Decoder
fintelia Nov 5, 2022
61234c0
Merge pull request #188 from fintelia/decoder-deprecated
HeroicKatora Nov 5, 2022
c900129
Change to non_exhaustive attributes
HeroicKatora Nov 5, 2022
0e9f8e3
Mark more tag enums as non_exhaustive
HeroicKatora Nov 5, 2022
7679be1
Merge pull request #189 from image-rs/non-exhaustive-enumeration
HeroicKatora Nov 10, 2022
7fc75f1
Changelog for 0.8
HeroicKatora Nov 4, 2022
65bc24d
Add deprecation removals to changelog
HeroicKatora Nov 5, 2022
9333d99
Merge pull request #187 from image-rs/release-0.8.0
HeroicKatora Nov 10, 2022
a08604b
added support for the YCbCr PhotometricInterpretation
kurtkuehnert Nov 16, 2022
7307e96
Removed `unwrap` and set colour transform with Jpeg compressed tiffs
AlanRace Aug 2, 2022
4f1c88e
Added unsupported error for interpretations not supported by JPEG
AlanRace Nov 22, 2022
b1cd459
Updated error handling
AlanRace Nov 22, 2022
a733ff1
Changed to using private constructor rather than From<> JpegDecoderError
AlanRace Nov 22, 2022
6c65e66
Merge pull request #170 from AlanRace/jpeg-unwrap
HeroicKatora Nov 22, 2022
1f7b25e
Fix read in packbits decoder
HeroicKatora Dec 3, 2022
aa42fcb
Merge pull request #193 from image-rs/issue-192-desync-packbits
HeroicKatora Dec 3, 2022
4dea7c4
Changelog and metadata for 0.8.1
HeroicKatora Dec 10, 2022
ffaccf2
Merge pull request #196 from image-rs/release-0.8.1
HeroicKatora Dec 10, 2022
21252d9
Fix padding when image size is multiple of chunk size
pka Dec 16, 2022
289fab2
Merge pull request #197 from pka/fix-padding
fintelia Dec 16, 2022
da07c0f
added round trip test
kurtkuehnert Jan 5, 2023
c30ea91
fixed ci
kurtkuehnert Jan 5, 2023
0da9770
Merge pull request #190 from kurtkuehnert/YCbCr_support
fintelia Jan 7, 2023
42feeba
Add basic support for planar configuration
pka Jan 12, 2023
2a15aa6
Support also tiled planar images
pka Jan 17, 2023
8fa175c
Fix capacity overflow in JpegReader
anfedotoff Feb 5, 2023
aa10d27
Merge pull request #200 from anfedotoff/master
HeroicKatora Feb 6, 2023
fcfcecb
Add changelog and metadata for 0.8.2
HeroicKatora Feb 6, 2023
bd1d085
Merge pull request #201 from image-rs/release-0.8.2
HeroicKatora Feb 6, 2023
d1ad9b2
Don't panic when parsing metadata when custom compression is used
AlanRace Mar 7, 2023
aefea77
Merge pull request #203 from AlanRace/custom-compression
HeroicKatora Mar 8, 2023
473868a
Merge pull request #199 from pka/planar-config
fintelia Jun 10, 2023
24d203c
Simplify and avoid allocation in jpeg decompression
fintelia Jun 11, 2023
daa0e3e
Merge pull request #206 from fintelia/simplify-jpeg
fintelia Jun 14, 2023
60f866c
A bunch of clippy fixes
fintelia Aug 20, 2023
8ec91b6
Cargo fmt
fintelia Aug 20, 2023
d6f6b8a
Merge pull request #213 from fintelia/fix-clippy
fintelia Aug 20, 2023
a67f505
Update edition and CI script, and add Cargo.lock.msrv (#212)
fintelia Aug 20, 2023
4a2e768
Allow arbitrary number of samples as long as all have the same bit de…
fintelia Oct 4, 2023
b0ba4a6
Release 0.9.1 (#220)
fintelia Jan 13, 2024
895c70a
Test minimal versions in CI (#223)
fintelia Feb 11, 2024
9b06e37
Sample format should not be a Vec (#226)
fintelia Mar 23, 2024
90ae5b8
Fix warnings (#225)
fintelia Mar 23, 2024
0c54a18
Add ColorType::Multiband enum variant to support samples>1 per pixel …
weiji14 Mar 24, 2024
307cd8b
Add SignedByte and SignedShort enum variants (#234)
weiji14 Jul 22, 2024
6dc7a26
Make decoding internally operate on byte buffers (#230)
fintelia Jul 23, 2024
de6d9cf
README.md: advertize JPEG decode support (#244)
rouault Sep 7, 2024
e28ad56
Add horizontal predictor support (#240)
spoutn1k Sep 23, 2024
96d3a02
Fix 1bpp image decoding and add a test image (#252)
fintelia Nov 1, 2024
ff52aea
Add support for iterating over all tags (#255)
gschulze Nov 26, 2024
a19cf37
Support ZSTD compression method for reading (#256)
stschake Dec 20, 2024
d42e6be
Fix formatting (#263)
fintelia Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Rust CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust: ["1.61.0", stable, beta, nightly]
steps:
- uses: actions/checkout@v2

- uses: dtolnay/rust-toolchain@nightly
if: ${{ matrix.rust == '1.61.0' }}
- name: Generate Cargo.lock with minimal-version dependencies
if: ${{ matrix.rust == '1.61.0' }}
run: cargo -Zminimal-versions generate-lockfile

- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: build
run: cargo build -v
- name: test
if: ${{ matrix.rust != '1.61.0' }}
run: cargo test -v && cargo doc -v

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run rustfmt check
run: cargo fmt -- --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-features # TODO: enable "-- -D warnings" once all outstanding clippy lints are fixed
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

193 changes: 193 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,196 @@
# Version 0.9.1

New features:
- Basic support for planar configuration.
- Allow arbitrary number of samples as long as all have the same bit depth.

Fixes:
- Don't panic when parsing metadata when custom compression is used.

# Version 0.9.0

New features:
* Added support for photometric interpretation `YCbCr` and added related
`ColorType`.

Fixes:
* Decoding tiled images calculates padding correctly when image width or height
is a multiple of tile size. It could previously corrupt the last tile per row
by skipping over data.

# Version 0.8.1

Changes:
* The jpeg decoder gained to ability to utilize the Photometric Interpretation
directly instead of relying on a custom APP segment.

Fixes:
* A spurious error within the PackBits decoder lead to the incorrect results
(wrong bits or errors), based on the maximum size of reads from the
underlying reader.
* Removed a panic path in jpeg decoding, when a feature such as photometric
interpretation is not supported. An error is returned instead.

# Version 0.8.0

Changes:
* The minimum supported rust version is now indicated in `Cargo.toml`.
* The enums `TiffFormatError` and `TiffUnsupportedError` are now
marked with the `#[non_exhaustive]` attribute.
* Additionally, tag related enums `Value`, `Tags`, `Type`, `CompressionMethod`,
`PhotometricInterpretation`, `PlanarConfiguration`, `Predictor`,
`ResolutionUnit`, `SampleFormat` are also changed.

Removals:
* Removed deprecated methods of `Decoder`: `init`, `read_jpeg`,
`read_strip_to_buffer`, `read_strip`, `read_tile`. The implicit chunk (row or
tile) index order could not be easily tracked by the caller. New separate
utility interfaces may be introduced at a later point, for now callers are
obligated to choose their own.

Fixes:
* Update to `jpeg_decoder = 0.3`.

# Version 0.7.4

New features:
* Creating an encoder for invalid, zero-sized images is now rejected.

Fixes:
* Fix panic, in a case where decoding jpeg encoded images did not expect the
jpeg decoder to return an error.
* Fix panic by validating `rows_per_strip` better, fixing a division-by-zero.

# Version 0.7.3

New features:
* Allow decoder to access specific tiles by index.
* Add support for floating point predictor.
* Tiled jpeg file support.

Changes:
* Various refactoring and performance improvements.

# Version 0.7.2

New features:
* Encoding with `ImageEncoder` now takes an optional compressor argument,
allowing compressed encoding. See the methods
`TiffEncoder::{new_image,write_image}_with_compression`.
* `jpeg_decoder` has been upgraded, now supports lossless JPEG.

Changes:
* Decoding now more consistently reads and interprets the initial IFD, instead
of performing _some_ interpretation lazily. (This change prepares fully lazy
and backwards seeking.)

# Version 0.7.1

New features:
* Encoding signed integer formats is now supported.
* Extensive fuzzing with `cargo fuzz`.

Changes:
* Tile decoding should be a little faster, requires one less intermediate buffer.
* Images whose IFDs form a cycle due to their offsets will now raise an error
when the cycle would be entered (jumping back should still be supported).

Fixes:
* Fixed a regression that caused conflict between strips and tile images,
causing errors in decoding some images.
* Use checked integer arithmetic in limit calculations, fixes overflows.
* IFD Tags are now always cleared between images.
* Found by fuzzing: Several memory limit overflows; JPEG now correctly
validates offsets and a minimum size of its table; Check upper limit of strip
byte size correctly;

Notes:
Our CI has warned that this version no longer builds on `1.34.2` out of the
box. We're still committed to the MSRV on this major version yet one
dependency—`flate2`—has already bumped it in a SemVer compatible version of its
own. This is out-of-our-control (cargo's dependency resolution does not allow
us to address this in a reasonable manner).

This can be address this by pinning the version of `flate2` to `1.0.21` in your
own files. However, you should understand that this puts you in considerable
maintenance debt as you will no longer receive any updates for this dependency
and any package that _requires_ a new version of the `1.0` series would be
incompatible with this requirement (cargo might yell at you very loudly).

# Version 0.7.0

New features:
* Support for encoding BigTiff ([#122](https://github.com/image-rs/image-tiff/pull/122))
* _Breaking:_ Encoder types now have a generic parameter to differentiate BigTiff and standard Tiff encoding. Defaults to standard Tiff.
* Basic tile decoding ([#125](https://github.com/image-rs/image-tiff/pull/125))
* _Breaking:_ There is a new `TiffError::UsageError` variant.
* Support for datatypes `Int8` and `Int16` ([#114](https://github.com/image-rs/image-tiff/pull/114))
* _Breaking:_ `DecodingResult` and `DecodingBuffer` have the two new variants `I8` and `I16`.
* Support for `i32` arrays ([#118](https://github.com/image-rs/image-tiff/pull/118/files))
* _Breaking:_ `DecodingResult` and `DecodingBuffer` have a new `I32` variant.
* Support for `Ifd` and `IfdBig` tag types and `I64` data type ([#119](https://github.com/image-rs/image-tiff/pull/119))
* _Breaking:_ `DecodingResult` and `DecodingBuffer` have a new `I64` variant.
* Add `SMinSampleValue` and `SMaxSampleValue` ([#123](https://github.com/image-rs/image-tiff/pull/123))

Changes:
* Improve deflate support ([#132](https://github.com/image-rs/image-tiff/pull/132))
* Switch to streaming decompression via `flate2`. Aside from performance improvements and lower RAM consumption, this fixes a bug where `max_uncompressed_length` was precalculated for a single tile but then used as a hard limit on the whole data, failing to decompress any tiled images.
* Add support for new `Deflate` tag in addition to `OldDeflate`.
* _Breaking:_ Remove `InflateError`, which is no longer needed with `flate2` ([#134](https://github.com/image-rs/image-tiff/pull/134))
* _Breaking:_ Support for `MinIsWhite` is restricted to unsigned and floating
point values. This is expected to be be re-added once some contradictory
interpretation regarding semantics for signed values is resolved.

Fixes:
* Validate that ASCII tags are valid ASCII and end with a null byte ([#121](https://github.com/image-rs/image-tiff/pull/121))

Internal:
* Simplify decompression logic ([#126](https://github.com/image-rs/image-tiff/pull/126))
* Simplify `expand_strip` ([#128](https://github.com/image-rs/image-tiff/pull/128))

# Version 0.6.1

New features:
* Support for reading `u16` and ascii string tags.
* Added `Limits::unlimited` for disabling all limits.
* Added `ImageEncoder::rows_per_strip` to overwrite the default.

Changes:
* The default strip size for chunked encoding is now 1MB, up from 8KB. This
should lead to more efficient decoding and compression.

Fixes:
* Fixed a bug where LZW compressed strips could not be decoded, instead
returning an error `Inconsistent sizes encountered`.
* Reading a tag with a complex type and a single value returns the proper Value
variant, instead of a vector with one entry.

# Version 0.6.0

New features:
* Support for decoding BigTIFF with 64-bit offsets
* The value types byte, `f32`, `f64` are now recognized
* Support for Modern JPEG encoded images

Improvements:
* Better support for adding auxiliary tags before encoding image data
* Switched to lzw decoder library `weezl` for performance
* The `ColorType` trait now supports `SAMPLE_ENCODING` hints

Fixes:
* Fixed decoding of inline ASCII in tags
* Fixed handling after null terminator in ASCII data
* Recognize tile and sample format tags

# Version 0.5.0

* Added support for 32-bit and 64-bit decoded values.
* Added CMYK(16|32|64) color type support.
* Check many internal integer conversions to increase stability. This should
only lead to images being reported as faulty that would previously silently
break platform limits. If there are any false positives, please report them.
* Remove an erroneous check of decoded length in lzw compressed images.

# Version 0.4.0

* Several enumerations are now non_exhaustive for future extensions.
Expand Down
38 changes: 23 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
[package]
name = "tiff"
version = "0.4.0"
authors = [
"ccgn",
"bvssvni <[email protected]>",
"nwin",
"TyOverby <[email protected]>",
"HeroicKatora",
"Calum",
"CensoredUsername <[email protected]>",
"Robzz",
"birktj"]
version = "0.9.1"
edition = "2021"
resolver = "2"

# note: when changed, also update test runner in `.github/workflows/rust.yml`
rust-version = "1.61.0"

license = "MIT"
description = "TIFF decoding and encoding library in pure Rust"
authors = ["The image-rs Developers"]

repository = "https://github.com/image-rs/image-tiff"
categories = ["multimedia::images", "multimedia::encoding"]

exclude = ["tests/images/*", "tests/fuzz_images/*"]

[dependencies]
byteorder = "1.2"
lzw = "0.10"
miniz_oxide = "0.3"
weezl = "0.1.0"
jpeg = { package = "jpeg-decoder", version = "0.3.0", default-features = false }
flate2 = "1.0.20"
zstd = { version = "0.13", optional = true }

[dev-dependencies]
tempfile = "3.0"
criterion = "0.3.1"

[features]
zstd = ["dep:zstd"]

[[bench]]
name = "lzw"
harness = false
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
# image-tiff
[![Build Status](https://travis-ci.org/image-rs/image-tiff.svg?branch=master)](https://travis-ci.org/image-rs/image-tiff)
[![Build Status](https://github.com/image-rs/image-tiff/workflows/Rust%20CI/badge.svg)](https://github.com/image-rs/image-tiff/actions)
[![Documentation](https://docs.rs/tiff/badge.svg)](https://docs.rs/tiff)
[![Further crate info](https://img.shields.io/crates/v/tiff.svg)](https://crates.io/crates/tiff)

TIFF decoding and encoding library in pure Rust

## Supported

### Features
- Baseline spec (other than formats and tags listed below as not supported)
- Multipage
- BigTIFF
- Incremental decoding

### Formats
This table lists photometric interpretations and sample formats which are supported for encoding and decoding. The entries are `ColorType` variants for which sample bit depths are supported. Only samples where all bit depths are equal are currently supported. For example, `RGB(8)` means that the bit depth [8, 8, 8] is supported and will be interpreted as an 8 bit per channel RGB color type.

| `PhotometricInterpretation` | UINT Format | IEEEFP Format |
| --------------------------- | --------------------------------------- | ------------------------- |
| `WhiteIsZero` | Gray(8\|16\|32\|64) | Gray(32\|64) |
| `BlackIsZero` | Gray(8\|16\|32\|64) | Gray(32\|64) |
| `RGB` | RGB(8\|16\|32\|64), RGBA(8\|16\|32\|64) | RGB(32\|64), RGBA(32\|64) |
| `RGBPalette` | | |
| `Mask` | | |
| `CMYK` | CMYK(8\|16\|32\|64) | CMYK(32\|64) |
| `YCbCr` | | |
| `CIELab` | | |

### Compressions

| | Decoding | Encoding |
| -------- | -------- | -------- |
| None | ✓ | ✓ |
| LZW | ✓ | ✓ |
| Deflate | ✓ | ✓ |
| PackBits | ✓ | ✓ |
| JPEG | ✓ | not yet |
| ZSTD | ✓ | not yet |


## Not yet supported

Formats and interpretations not listed above or with empty entries are unsupported.

- Baseline tags
- `ExtraSamples`
- Extension tags

## Fuzzing

This crate uses [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz) in order to test the image parser.

After installing it with `cargo install cargo-fuzz` on a nightly rustc, the
fuzzing harness can be run with recommended settings using
`cargo fuzz run decode_image -snone -- -timeout=5`.
Loading