-
Notifications
You must be signed in to change notification settings - Fork 58
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
Changes from 6 commits
a86db56
911f83d
bd4bbc2
151d01a
69588af
2d16d14
26291c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
object_locations, save_jumbf_to_file, | ||
object_locations, remove_jumbf_from_file, save_jumbf_to_file, | ||
}, | ||
utils::{ | ||
hash_utils::{hash256, Exclusion}, | ||
|
@@ -1610,10 +1610,14 @@ impl Store { | |
dest_path.to_path_buf() | ||
} | ||
crate::claim::RemoteManifest::SideCar => { | ||
// remove any previous c2pa manifest from the asset | ||
remove_jumbf_from_file(dest_path)?; | ||
dest_path.with_extension(MANIFEST_STORE_EXT) | ||
} | ||
crate::claim::RemoteManifest::Remote(_url) => { | ||
let d = dest_path.with_extension(MANIFEST_STORE_EXT); | ||
// remove any previous c2pa manifest from the asset | ||
remove_jumbf_from_file(dest_path)?; | ||
// even though this block is protected by the outer cfg!(feature = "xmp_write") | ||
// the class embedded_xmp is not defined so we have to explicitly exclude it from the build | ||
#[cfg(feature = "xmp_write")] | ||
|
@@ -1634,6 +1638,8 @@ impl Store { | |
match pc.remote_manifest() { | ||
crate::claim::RemoteManifest::NoRemote => dest_path.to_path_buf(), | ||
crate::claim::RemoteManifest::SideCar => { | ||
// remove any previous c2pa manifest from the asset | ||
remove_jumbf_from_file(dest_path)?; | ||
dest_path.with_extension(MANIFEST_STORE_EXT) | ||
} | ||
crate::claim::RemoteManifest::Remote(_) | ||
|
There was a problem hiding this comment.
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 anyawait
orasync
inside the function.There was a problem hiding this comment.
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.