feat: Decouple asset_handlers
into c2pa-codecs
crate
#533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes in this pull request
Decouples asset_handler/asset_io into its own crate.
Changes
Encode
/Decode
trait with the following methods:write_c2pa
,remove_c2pa
,patch_c2pa
,write_xmp
,write_xmp_provenance
,remove_xmp
,remove_xmp_provenance
read_c2pa
,read_xmp
,read_xmp_provenance
Hash
trait with 5 methods:hash
,data_hash
,box_hash
,bmff_hash
,collection_hash
Hasher::hash
whilst also implementing any other supported hashesSupporter
trait with 3 methods:supports_signature
,supports_extension
,supports_mime
.Embed
trait (composed manifests)Embeddable
withembeddable
, read it from a stream withread_embeddable
and write it to a stream withwrite_embeddable
Codec
is the new entry-point for asset handlersCodec::from_stream(&mut stream).read_c2pa()
Codec
struct can be created with an external codec that implements the desired traits (user-defined codecs)Testing
Related issues
Checklist
TO DO
items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.