diff options
author | Valentin Popov <valentin@popov.link> | 2024-01-08 00:21:28 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-01-08 00:21:28 +0300 |
commit | 1b6a04ca5504955c571d1c97504fb45ea0befee4 (patch) | |
tree | 7579f518b23313e8a9748a88ab6173d5e030b227 /vendor/exr/examples/0b_read_meta.rs | |
parent | 5ecd8cf2cba827454317368b68571df0d13d7842 (diff) | |
download | fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.tar.xz fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.zip |
Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
Diffstat (limited to 'vendor/exr/examples/0b_read_meta.rs')
-rw-r--r-- | vendor/exr/examples/0b_read_meta.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/exr/examples/0b_read_meta.rs b/vendor/exr/examples/0b_read_meta.rs new file mode 100644 index 0000000..a20527f --- /dev/null +++ b/vendor/exr/examples/0b_read_meta.rs @@ -0,0 +1,22 @@ + + +// exr imports +extern crate exr; + +/// Print the custom meta data of a file, excluding technical encoding meta data. +/// Prints compression method and tile size, but not purely technical data like chunk count. +fn main() { + use exr::prelude::*; + + let meta_data = MetaData::read_from_file( + "generated_rgba_with_meta.exr", + false // do not throw an error for invalid or missing attributes, skipping them instead + ).expect("run example `1_write_rgba_with_metadata` to generate the required file"); + + for (layer_index, image_layer) in meta_data.headers.iter().enumerate() { + println!( + "custom meta data of layer #{}:\n{:#?}", + layer_index, image_layer.own_attributes + ); + } +}
\ No newline at end of file |