@@ -530,11 +530,35 @@ def load_settings(settings: str, format: str = "json") -> None:
530530 raise C2paError (error )
531531
532532
533+ def read_ingredient_file (
534+ path : Union [str , Path ], data_dir : Union [str , Path ]) -> str :
535+ """Read a C2PA ingredient from a file.
536+
537+ Args:
538+ path: Path to the file to read
539+ data_dir: Directory to write binary resources to
540+
541+ Returns:
542+ The ingredient as a JSON string
543+
544+ Raises:
545+ C2paError: If there was an error reading the file
546+ """
547+ container = _StringContainer ()
548+
549+ container ._path_str = str (path ).encode ('utf-8' )
550+ container ._data_dir_str = str (data_dir ).encode ('utf-8' )
551+
552+ result = _lib .c2pa_read_ingredient_file (
553+ container ._path_str , container ._data_dir_str )
554+ return _parse_operation_result_for_error (result )
555+
556+
533557def read_file (path : Union [str , Path ],
534558 data_dir : Union [str , Path ]) -> str :
535559 """Read a C2PA manifest from a file.
536560
537- .. deprecated:: 0.10.12
561+ .. deprecated:: 0.10.0
538562 This function is deprecated and will be removed in a future version.
539563 Please use the Reader class for reading C2PA metadata instead.
540564 Example:
@@ -569,30 +593,6 @@ def read_file(path: Union[str, Path],
569593 return _parse_operation_result_for_error (result )
570594
571595
572- def read_ingredient_file (
573- path : Union [str , Path ], data_dir : Union [str , Path ]) -> str :
574- """Read a C2PA ingredient from a file.
575-
576- Args:
577- path: Path to the file to read
578- data_dir: Directory to write binary resources to
579-
580- Returns:
581- The ingredient as a JSON string
582-
583- Raises:
584- C2paError: If there was an error reading the file
585- """
586- container = _StringContainer ()
587-
588- container ._path_str = str (path ).encode ('utf-8' )
589- container ._data_dir_str = str (data_dir ).encode ('utf-8' )
590-
591- result = _lib .c2pa_read_ingredient_file (
592- container ._path_str , container ._data_dir_str )
593- return _parse_operation_result_for_error (result )
594-
595-
596596def sign_file (
597597 source_path : Union [str , Path ],
598598 dest_path : Union [str , Path ],
@@ -602,7 +602,7 @@ def sign_file(
602602) -> str :
603603 """Sign a file with a C2PA manifest.
604604
605- .. deprecated:: 0.10.12
605+ .. deprecated:: 0.10.0
606606 This function is deprecated and will be removed in a future version.
607607 Please use the Builder class for signing and the Reader class for reading signed data instead.
608608
0 commit comments