Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bad example in Crate docs, from_file not implemented in ManifestStore #92

Closed
ronald-das opened this issue Jul 25, 2022 · 5 comments
Closed
Assignees

Comments

@ronald-das
Copy link

Hi, while going through the example in https://docs.rs/c2pa/latest/c2pa/#example-reading-a-manifeststore
Am getting not implemented error (E0599)

error[E0599]: no function or associated item named `from_file` found for struct `ManifestStore` in the current scope
 --> src/main.rs:4:41
  |
4 |     let manifest_store = ManifestStore::from_file("tests/fixtures/C.jpg")?;
  |                                         ^^^^^^^^^ function or associated item not found in `ManifestStore`

My cargo.toml file

[dependencies]
c2pa = "0.11.0"
@ronald-das
Copy link
Author

After going through the struct documentation https://docs.rs/c2pa/latest/c2pa/struct.ManifestStore.html#method.from_file , file_io feature needs to enabled for it to work.

New Cargo.toml file

[dependencies]
c2pa = {version="0.11.0", features=["file_io"]}

@scouten-adobe
Copy link
Collaborator

@ronald-das thanks for bringing this to our attention. I'm reopening the ticket. I think we should add a note in the README to mention that file_io feature is needed. @crandmck or @gpeacock, would one of you please add this?

@crandmck
Copy link
Collaborator

Should we just change the Cargo.toml file in "Usage" section to be

c2pa = {version="0.11.0", features=["file_io"]}

or should we qualify it by just adding something like "If you want to read or write a manifest file, add this to your Cargo.toml..." ?

@gpeacock
Copy link
Collaborator

We should describe the features somewhere and how and when to use them. Since the file_io feature enables a lot of the sdk, we should make special mention of it with something like the above. I'd be in favor of having the example include it with a note that if building for WASM you should leave it out.

@crandmck
Copy link
Collaborator

crandmck commented Aug 1, 2022

Addressed (partially, at least) by #93.

@crandmck crandmck closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants