Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(MINOR) Remove previously embedded manifests for remote manifests #136

Merged
merged 7 commits into from
Sep 23, 2022

Conversation

gpeacock
Copy link
Collaborator

Changes in this pull request

Assets with remote manifests should remove previously embedded manifests
This fixes a bug when writing remote manifests and not updating an embedded manifest. The embedded manifest will now be removed from the output asset.

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

@codecov-commenter
Copy link

codecov-commenter commented Sep 22, 2022

Codecov Report

Merging #136 (26291c8) into main (c7eb0b0) will increase coverage by 0.15%.
The diff coverage is 94.73%.

@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   78.22%   78.37%   +0.15%     
==========================================
  Files          66       66              
  Lines       14495    14565      +70     
==========================================
+ Hits        11338    11415      +77     
+ Misses       3157     3150       -7     
Impacted Files Coverage Δ
sdk/src/store.rs 85.11% <75.00%> (-0.05%) ⬇️
sdk/src/jumbf_io.rs 88.65% <83.33%> (-0.36%) ⬇️
sdk/src/manifest.rs 91.31% <100.00%> (+0.87%) ⬆️
make_test_images/src/make_test_images.rs 67.78% <0.00%> (ø)
sdk/src/claim.rs 83.80% <0.00%> (+0.09%) ⬆️
sdk/src/asset_handlers/png_io.rs 94.48% <0.00%> (+0.32%) ⬆️
sdk/src/ingredient.rs 89.42% <0.00%> (+0.67%) ⬆️
sdk/src/validation_status.rs 81.14% <0.00%> (+2.45%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -32,7 +32,7 @@ use crate::{
cose_validator::verify_cose,
jumbf_io::{
get_file_extension, get_supported_file_extension, is_bmff_format, load_jumbf_from_file,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably do one more thing in this function. If we remove the manifest we should clear the XMP. It will be cleared for the remote case but not the sidecar case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add that in a different PR as to not hold this up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. We might need to check if there was something we needed to delete in the case where xmp_write is disabled, otherwise we could return an error when there's nothing wrong.

We also need to figure out how to remove c2pa jumbf from in memory buffers. But that can also wait for later.

Copy link
Collaborator

@mauricefisher64 mauricefisher64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


#[cfg(all(feature = "file_io", feature = "xmp_write"))]
#[actix::test]
async fn test_embed_sidecar_with_parent_manifest() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an async test? I don't see any await or async inside the function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, I removed async from some of the other tests that didn't need it.

@gpeacock gpeacock changed the title Remove previously embedded manifests for remote manifests (MINOR) Remove previously embedded manifests for remote manifests Sep 23, 2022
@gpeacock gpeacock merged commit 3df6dcd into main Sep 23, 2022
@gpeacock gpeacock deleted the gpeacock/remote_ingredients_fix branch September 23, 2022 02:00
mauricefisher64 added a commit that referenced this pull request Sep 30, 2022
…ff_support

* 'main' of https://github.com/contentauth/c2pa-rs: (78 commits)
  Add Exif Assertion support (#140)
  (IGNORE) Disregard grep non-zero exit status (#139)
  Prepare 0.14.0 release
  (IGNORE) Fix GH Actions logic error that is causing CI failure now (#137)
  (MINOR) Remove previously embedded manifests for remote manifests (#136)
  (MINOR) Add support for manifest removal (#123)
  Prepare 0.13.2 release
  manifest_data was missing for remote manifests (#135)
  (IGNORE) Restore cargo-semver-checks step (#129)
  Prepare 0.13.1 release
  Add ManifestStore::from_manifest_and_asset_bytes_async (#130)
  (IGNORE) Disable cargo-semver-checks step (#126)
  (IGNORE) Enforce semantic versioning requirements during PR validation and publish workflows (#124)
  Prepare 0.13.0 release
  Add RemoteManifestUrl Error, returning url (#120)
  Convert status_log error val to a string so that we can return full errors (#121)
  Report failures from remote manifest fetch (#116)
  Fast XMP extraction from PNG (#117)
  Bump MSRV to 1.59.0 (#118)
  Make sure there is  a single manifest store in the asset (#114)
  ...

# Conflicts:
#	sdk/src/error.rs
#	sdk/src/jumbf_io.rs
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants