show.rs (1015B)
1 // Copyright 2022 Adobe. All rights reserved. 2 // This file is licensed to you under the Apache License, 3 // Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) 4 // or the MIT license (http://opensource.org/licenses/MIT), 5 // at your option. 6 7 // Unless required by applicable law or agreed to in writing, 8 // this software is distributed on an "AS IS" BASIS, WITHOUT 9 // WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or 10 // implied. See the LICENSE-MIT and LICENSE-APACHE files for the 11 // specific language governing permissions and limitations under 12 // each license. 13 14 //! Example App that generates a manifest store listing for a given file 15 use anyhow::Result; 16 use c2pa::Reader; 17 18 #[cfg(not(target_arch = "wasm32"))] 19 fn main() -> Result<()> { 20 let args: Vec<String> = std::env::args().collect(); 21 if args.len() > 1 { 22 let ms = Reader::from_file(&args[1])?; 23 println!("{ms}"); 24 } else { 25 println!("Prints a manifest report (requires a file path argument)") 26 } 27 Ok(()) 28 }