Open MTRNord opened 5 months ago
We will discuss support for this in SDK.
Please send us a sample file and we can investigate
Sorry for the delayed reply. Below are 2 cr3 files. One already signed using c2pa-rs and a patch adding cr3 to the list of filetypes and one not yet signed straight from the camera.
compressed due to requirements from github. Photo taken by me on a Canon EOS R8. Feel free to use it under CC0 if thats working for you :) It does already have a signature.
```json { "active_manifest": "urn:uuid:9744236e-b160-4ebb-9fc4-247d15df3380", "manifests": { "urn:uuid:9744236e-b160-4ebb-9fc4-247d15df3380": { "claim_generator": "MTRNord_Photography_Manager/0.1.0 c2pa-rs/0.32.2", "title": "IMG_4650.CR3", "format": "image/x-canon-cr3", "instance_id": "xmp:iid:26f0c6ec-4401-48b4-ab61-a1b568c2a60c", "ingredients": [ { "title": "IMG_4650.CR3", "format": "image/x-canon-cr3", "instance_id": "xmp:iid:51274428-df9a-48c9-8eb1-a00b256a8f0e", "relationship": "parentOf" } ], "assertions": [ { "label": "c2pa.actions", "data": { "actions": [ { "action": "c2pa.created" } ] } }, { "label": "c2pa.ai_training", "data": { "use": "notAllowed", "constraintInfo": null } }, { "label": "c2pa.ai_generative_training", "data": { "use": "notAllowed", "constraintInfo": null } }, { "label": "c2pa.data_mining", "data": { "use": "notAllowed", "constraintInfo": null } }, { "label": "c2pa.inference", "data": { "use": "notAllowed", "constraintInfo": null } }, { "label": "stds.schema-org.CreativeWork", "data": { "@context": "https://schema.org", "@type": "CreativeWork", "author": [ { "@context": "https://schema.org", "@type": "Person", "identifier": "MTRNord", "@id": "https://instagram.com", "name": "MTRNord" } ] }, "kind": "Json" }, { "label": "stds.schema-org.CreativeWork", "data": { "@context": "https://schema.org", "@type": "CreativeWork", "url": "https://mtrnord.blog" }, "instance": 1, "kind": "Json" }, { "label": "stds.schema-org.CreativeWork", "data": { "@context": "https://schema.org", "@type": "CreativeWork", "author": [ { "@context": "https://schema.org", "@type": "Person", "name": "AEDE3887B1551783", "@id": "https://keys.openpgp.org", "identifier": "9768 CA63 F48D 3609 8567 A59D AEDE 3887 B155 1783" } ] }, "instance": 2, "kind": "Json" }, { "label": "stds.exif", "data": { "@context": { "dc": "http://purl.org/dc/elements/1.1/", "exifEX": "http://cipa.jp/exif/2.32/", "exif": "http://ns.adobe.com/exif/1.0/", "tiff": "http://ns.adobe.com/tiff/1.0/", "xmp": "http://ns.adobe.com/xap/1.0/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#" }, "exif:FNumber": 2.0, "exifEX:LensModel": "EF50mm f/1.8 STM", "exif:ExposureTime": "1/4000" }, "kind": "Json" }, { "label": "c2pa.hash.bmff.v2", "data": { "exclusions": [ { "xpath": "/uuid", "length": null, "data": [ { "offset": 8, "value": [ 216, 254, 195, 214, 27, 14, 72, 60, 146, 151, 88, 40, 135, 126, 196, 129 ] } ], "subset": null, "version": null, "flags": null, "exact": null }, { "xpath": "/ftyp", "length": null, "data": null, "subset": null, "version": null, "flags": null, "exact": null }, { "xpath": "/meta/iloc", "length": null, "data": null, "subset": null, "version": null, "flags": null, "exact": null }, { "xpath": "/mfra/tfra", "length": null, "data": null, "subset": null, "version": null, "flags": null, "exact": null }, { "xpath": "/moov/trak/mdia/minf/stbl/stco", "length": null, "data": null, "subset": [ { "offset": 16, "length": 0 } ], "version": null, "flags": null, "exact": null }, { "xpath": "/moov/trak/mdia/minf/stbl/co64", "length": null, "data": null, "subset": [ { "offset": 16, "length": 0 } ], "version": null, "flags": null, "exact": null }, { "xpath": "/moof/traf/tfhd", "length": null, "data": null, "subset": [ { "offset": 16, "length": 8 } ], "version": null, "flags": [ 1, 0, 0 ], "exact": null }, { "xpath": "/moof/traf/trun", "length": null, "data": null, "subset": [ { "offset": 16, "length": 4 } ], "version": null, "flags": [ 1, 0, 0 ], "exact": null } ], "alg": "sha256", "hash": "qkteOatW+yqZYGRvAusoVuQYWAGemv0fxynNq6Pzkbg=", "name": "jumbf manifest" } } ], "signature_info": { "alg": "Es256", "issuer": "MTRNord", "cert_serial_number": "1394774989354528955397704349500428433318678915552" }, "label": "urn:uuid:9744236e-b160-4ebb-9fc4-247d15df3380" } } } ```
If thats an issue below is one under the same conditions which isnt yet signed. (I am running a cr3 compat fork with some other stuff over at https://github.com/mtrnords-photography-manager/c2pa-rs/ for my use)
Hi :)
I locally out of interested tested the code with cr3 files, and it seems like just adding it to the list works considering there are mostly just canon specific tags in it. Would be nice to add it to the list of filetypes :)
If you need some test file for CI I am happy to provide one of my images at any licence required.
Locally I tried this with appending
cr3
to https://github.com/contentauth/c2pa-rs/blob/main/sdk/src/asset_handlers/bmff_io.rs#L68This with the example spits out:
Which to my untrained eye indicates it is working. there is no visual corruption either so its not overwriting image data for it to work either.