| 1 |
extern crate tiffrust-analyzer cargo tiff 0.11.3 tiff/; |
| 2 |
|
| 3 |
use tiffrust-analyzer cargo tiff 0.11.3 crate/::decoderrust-analyzer cargo tiff 0.11.3 decoder/::Decoderrust-analyzer cargo tiff 0.11.3 decoder/Decoder#; |
| 4 |
use tiffrust-analyzer cargo tiff 0.11.3 crate/::tagsrust-analyzer cargo tiff 0.11.3 tags/::Tagrust-analyzer cargo tiff 0.11.3 tags/Tag#; |
| 5 |
use tiffrust-analyzer cargo tiff 0.11.3 crate/::ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#; |
| 6 |
|
| 7 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#; |
| 8 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#; |
| 9 |
|
| 10 |
const TEST_IMAGE_DIRrust-analyzer cargo tiff 0.11.3 TEST_IMAGE_DIR.: &str = "./tests/images/bigtiff"; |
| 11 |
|
| 12 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| •13 |
#[ignore = "skipping, missing test data"] |
| 14 |
fn test_big_tiffrust-analyzer cargo tiff 0.11.3 test_big_tiff().() { |
| 15 |
let filenames = ["BigTIFF.tif", "BigTIFFMotorola.tif", "BigTIFFLong.tif"]; |
| 16 |
for filename in filenames.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() { |
| 17 |
let path = PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#::fromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf][`From<&T>`]from().(TEST_IMAGE_DIRrust-analyzer cargo tiff 0.11.3 TEST_IMAGE_DIR.).joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().(filename); |
| 18 |
let img_file = Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().(path).expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Cannot find test image!"); |
| 19 |
let mut decoder = Decoderrust-analyzer cargo tiff 0.11.3 decoder/Decoder#::newrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]new().(img_file).expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Cannot create decoder"); |
| 20 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 21 |
decoder.dimensionsrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]dimensions().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Cannot get dimensions"), |
| 22 |
(64, 64) |
| 23 |
); |
| 24 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 25 |
decoder.colortyperust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]colortype().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Cannot get colortype"), |
| 26 |
ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::RGBrust-analyzer cargo tiff 0.11.3 ColorType#RGB#(8) |
| 27 |
); |
| 28 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 29 |
decoder |
| 30 |
.get_tag_u64rust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]get_tag_u64().(Tagrust-analyzer cargo tiff 0.11.3 tags/Tag#::StripOffsetsrust-analyzer cargo tiff 0.11.3 tags/Tag#StripOffsets#) |
| 31 |
.expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Cannot get StripOffsets"), |
| 32 |
16 |
| 33 |
); |
| 34 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 35 |
decoder |
| 36 |
.get_tag_u64rust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]get_tag_u64().(Tagrust-analyzer cargo tiff 0.11.3 tags/Tag#::RowsPerStriprust-analyzer cargo tiff 0.11.3 tags/Tag#RowsPerStrip#) |
| 37 |
.expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Cannot get RowsPerStrip"), |
| 38 |
64 |
| 39 |
); |
| 40 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 41 |
decoder |
| 42 |
.get_tag_u64rust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]get_tag_u64().(Tagrust-analyzer cargo tiff 0.11.3 tags/Tag#::StripByteCountsrust-analyzer cargo tiff 0.11.3 tags/Tag#StripByteCounts#) |
| 43 |
.expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Cannot get StripByteCounts"), |
| 44 |
12288 |
| 45 |
) |
| 46 |
} |
| 47 |
} |