Skip to content

Create a Format enum for file format/mime type #1268

@ok-nick

Description

@ok-nick

It's not clear in the API which file formats/mime types are supported. We also often end up string matching when dealing with different file formats. I think we can make some big improvements by introducing a Format enum similar to image::ImageFormat.

We can provide methods such as:

  • c2pa::format_from_path -> Format::from_path
  • Format::from_extension
  • Format::from_mime_type
  • Format::mime_type
  • Format::format
  • Format::extensions
  • Format::can_read
  • Format::can_write

Source: #1260 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0 blockerPotentially breaks API compatibility; consider before 1.0 releasestatus:triagedIssues that have been looked at but not working on yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions