zenmeta/exif.rs
1//! EXIF rewrite entry points using zencodec's published interchange types.
2//!
3//! Reading remains available through `zencodec::Exif` without zenmeta. These
4//! functions delegate to the retained compatibility implementation, avoiding a
5//! duplicate parser/writer until the next breaking zencodec release.
6use alloc::{borrow::Cow, vec::Vec};
7use zencodec::{Exif, ExifPolicy};
8
9/// Filter a parsed EXIF tree. Opaque offset-bearing metadata is not relocated.
10#[allow(deprecated)]
11pub fn filter<'a>(exif: &Exif<'a>, policy: &ExifPolicy) -> Exif<'a> {
12 exif.filtered(policy)
13}
14
15/// Serialize a parsed EXIF tree. This is not byte-exact preservation.
16#[allow(deprecated)]
17pub fn serialize(exif: &Exif<'_>) -> Vec<u8> {
18 exif.to_bytes()
19}
20
21/// Retain EXIF under a policy; KEEP_ALL borrows the original bytes unchanged.
22#[allow(deprecated)]
23pub fn retain<'a>(bytes: &'a [u8], policy: &ExifPolicy) -> Option<Cow<'a, [u8]>> {
24 zencodec::exif::retain(bytes, policy)
25}