c2pa-rs

A fork of https://github.com/contentauth/c2pa-rs/
git clone git://archive.git.mtrnord.blog/mtrnords-photography-manager/c2pa-rs.git
Log | Files | Refs | README

commit 680871e00e4c811381b1d5f1dbaaae36cfaf0b45
parent b0f76b52ffc4fac8549f74d52759c27b1eee24c0
Author: Eric Scouten <scouten@adobe.com>
Date:   Tue, 21 Nov 2023 15:33:09 -0800

(IGNORE) Add crate private API Claim::replace_assertion (#347)


Diffstat:
Msdk/src/claim.rs | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sdk/src/claim.rs b/sdk/src/claim.rs @@ -936,8 +936,16 @@ impl Claim { // Crate private function to allow for patching a BMFF hash with final contents. #[cfg(feature = "file_io")] pub(crate) fn update_bmff_hash(&mut self, bmff_hash: BmffHash) -> Result<()> { + self.replace_assertion(bmff_hash.to_assertion()?) + } + + // Patch an existing assertion with new contents. + // + // `replace_with` should match in name and size of an existing assertion. + #[cfg(feature = "file_io")] + pub(crate) fn replace_assertion(&mut self, replace_with: Assertion) -> Result<()> { self.update_assertion( - bmff_hash.to_assertion()?, + replace_with, |_: &ClaimAssertion| true, |_: &ClaimAssertion, a: Assertion| Ok(a), )