diff --git a/Cargo.lock b/Cargo.lock index 6b6197239..f8fcd7b73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1313,7 +1313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1145d32e826a7748b69ee8fc62d3e6355ff7f1051df53141e7048162fc90481b" dependencies = [ "data-encoding", - "syn 2.0.96", + "syn 1.0.109", ] [[package]] @@ -2928,9 +2928,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.69" +version = "0.10.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" +checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ "bitflags 2.8.0", "cfg-if", @@ -2969,9 +2969,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" dependencies = [ "cc", "libc", diff --git a/Makefile b/Makefile index 9a657ab96..e3f8b0a81 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ check-docs: cargo doc --no-deps --workspace --all-features clippy: - cargo +nightly clippy --all-features --all-targets -- -D warnings + cargo clippy --all-features --all-targets -- -D warnings test-local: cargo test --all-features @@ -30,13 +30,13 @@ test-wasm: test-wasm-web: cd sdk && wasm-pack test --chrome --headless -- --features="serialize_thumbnails" - + # Full local validation, build and test all features including wasm # Run this before pushing a PR to pre-validate test: check-format check-docs clippy test-local test-wasm-web # Auto format code according to standards -fmt: +fmt: cargo +nightly fmt # Builds and views documentation diff --git a/cli/Makefile b/cli/Makefile index b73138f22..286c8507b 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -26,7 +26,7 @@ test-local: # Run this before pushing a PR to pre-validate test: check-format clippy test-local -fmt: +fmt: cargo +nightly fmt # Creates a folder wtih c2patool bin, samples and readme @@ -57,6 +57,7 @@ build-release-mac-universal: build-release-mac-arm build-release-mac-x86 build-release-linux: cargo build --release +# make release # Builds and packages a zip for c2patool for each platform ifeq ($(PLATFORM), mac) release: build-release-mac-universal c2patool-package diff --git a/cli/src/main.rs b/cli/src/main.rs index 00030f7f8..1c3d56203 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -709,7 +709,7 @@ pub mod tests { "assertions": [ { "label": "org.contentauth.test", - "data": {"my_key": "whatever I want"} + "data": {"my_key": "whatever I want"} } ] }"#; diff --git a/cli/src/signer.rs b/cli/src/signer.rs index 339ed4cc6..1022533ac 100644 --- a/cli/src/signer.rs +++ b/cli/src/signer.rs @@ -117,7 +117,7 @@ pub mod tests { #![allow(clippy::unwrap_used)] use super::*; - const CONFIG: &str = r#"{ + const CONFIG: &str = r#"{ "alg": "es256", "private_key": "es256_private.key", "sign_cert": "es256_certs.pem", diff --git a/sdk/src/assertions/actions.rs b/sdk/src/assertions/actions.rs index 2c23236d7..159051191 100644 --- a/sdk/src/assertions/actions.rs +++ b/sdk/src/assertions/actions.rs @@ -32,34 +32,52 @@ pub const CAI_INGREDIENT_IDS: &str = "org.cai.ingredientIds"; pub mod c2pa_action { /// Changes to tone, saturation, etc. pub const COLOR_ADJUSTMENTS: &str = "c2pa.color_adjustments"; + /// The format of the asset was changed. pub const CONVERTED: &str = "c2pa.converted"; + /// The asset was first created, usually the asset's origin. pub const CREATED: &str = "c2pa.created"; + /// Areas of the asset's "editorial" content were cropped out. pub const CROPPED: &str = "c2pa.cropped"; + /// Changes using drawing tools including brushes or eraser. pub const DRAWING: &str = "c2pa.drawing"; + /// Generalized actions that affect the "editorial" meaning of the content. pub const EDITED: &str = "c2pa.edited"; + /// Changes to appearance with applied filters, styles, etc. pub const FILTERED: &str = "c2pa.filtered"; + /// An existing asset was opened and is being set as the `parentOf` ingredient. pub const OPENED: &str = "c2pa.opened"; + /// Changes to the direction and position of content. pub const ORIENTATION: &str = "c2pa.orientation"; + /// Added/Placed a `componentOf` ingredient into the asset. pub const PLACED: &str = "c2pa.placed"; + /// Asset is released to a wider audience. pub const PUBLISHED: &str = "c2pa.published"; + + /// Repackage from one container to another. + /// /// A conversion of one packaging or container format to another. Content may be repackaged without transcoding. /// Does not include any adjustments that would affect the "editorial" meaning of the content. pub const REPACKAGED: &str = "c2pa.repackaged"; + /// Changes to content dimensions and/or file size pub const RESIZED: &str = "c2pa.resized"; - /// A direct conversion of one encoding to another, including resolution scaling, bitrate adjustment and encoding format change. + + /// Direct conversion of one encoding to another. + /// + /// This included resolution scaling, bitrate adjustment and encoding format change. /// Does not include any adjustments that would affect the "editorial" meaning of the content. pub const TRANSCODED: &str = "c2pa.transcoded"; + /// Something happened, but the claim_generator cannot specify what. pub const UNKNOWN: &str = "c2pa.unknown"; } diff --git a/sdk/src/jumbf_io.rs b/sdk/src/jumbf_io.rs index 25e7448b8..cd416f966 100644 --- a/sdk/src/jumbf_io.rs +++ b/sdk/src/jumbf_io.rs @@ -194,9 +194,13 @@ pub(crate) fn get_supported_file_extension(path: &Path) -> Option { } #[cfg(feature = "file_io")] -/// save_jumbf to a file -/// in_path - path is source file -/// out_path - path to the output file +/// Save JUMBF data to a file. +/// +/// Parameters: +/// * save_jumbf to a file +/// * in_path - path is source file +/// * out_path - path to the output file +/// /// If no output file is given an new file will be created with "-c2pa" appending to file name e.g. "test.jpg" => "test-c2pa.jpg" /// If input == output then the input file will be overwritten. pub fn save_jumbf_to_file(data: &[u8], in_path: &Path, out_path: Option<&Path>) -> Result<()> { diff --git a/sdk/src/reader.rs b/sdk/src/reader.rs index fda4738b6..fa650a884 100644 --- a/sdk/src/reader.rs +++ b/sdk/src/reader.rs @@ -267,7 +267,7 @@ impl Reader { /// /// Call this method to check for detailed validation results. /// The validation_state method should be used to determine the overall validation state. - /// + /// /// The results are divided between the active manifest and ingredient deltas. /// The deltas will only exist if there are validation errors not already reported in ingredients /// It is normal for there to be many success and information statuses. @@ -388,7 +388,7 @@ impl Reader { /// Write all resources to a folder. /// /// - /// This function writes all resources to a folder. + /// This function writes all resources to a folder. /// Resources are stored in sub-folders corresponding to manifest label. /// Conversions ensure the file paths are valid. /// diff --git a/sdk/src/validation_status.rs b/sdk/src/validation_status.rs index 4ee49a37c..d1085b4c8 100644 --- a/sdk/src/validation_status.rs +++ b/sdk/src/validation_status.rs @@ -282,6 +282,8 @@ pub fn validation_results_for_store( // TODO: Does this still need to be public? (I do see one reference in the JS SDK.) +/// Get the validation status for a store. +/// /// Given a `Store` and a `StatusTracker`, return `ValidationStatus` items for each /// item in the tracker which reflect errors in the active manifest or which would not /// be reported as a validation error for any ingredient.