Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ pub mod tests {
"assertions": [
{
"label": "org.contentauth.test",
"data": {"my_key": "whatever I want"}
"data": {"my_key": "whatever I want"}
}
]
}"#;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 19 additions & 1 deletion sdk/src/assertions/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
10 changes: 7 additions & 3 deletions sdk/src/jumbf_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,13 @@ pub(crate) fn get_supported_file_extension(path: &Path) -> Option<String> {
}

#[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<()> {
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
///
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/validation_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down