API / Minn\Media / Metadata

Metadata final class

Minn\Media\Metadata · public/minn/src/Minn/Media/Metadata.php · 112 lines

The _wp_attachment_metadata blob: parsed by scanning for the shapes it holds (top-level dims and file, the sizes map, the image_meta scalars) and written back in the reference's stored form: a:6 at the top, image_meta as a:13 with alt last.

Constants and properties

privateIMAGE_META_KEYS = array ( 0 => 'aperture', 1 => 'credit', 2 => 'camera', 3 => 'caption', 4 => 'created_timestamp', 5 => 'copyright', 6 => 'focal_length', 7 => 'iso', 8 => 'shutter_speed', 9 => 'title', 10 => 'orientation', )

Public

staticnamesFile(string $location, array $meta): bool#

Whether an image location names the attachment's file, one of its sizes, or its original (probe media-tags): the location, its query dropped, must end with the stored path, or with the stored folder and a size's or the original's file name. A bare file name with no folder matches nothing.

$metaarray<string, mixed>the attachment metadata as stored
staticparse(?string $blob): array#

The attachment metadata blob as an array, tolerant of anything missing.

@return array{width: int, height: int, file: string, filesize: int, sizes: array<string, array>, image_meta: ?array}
staticblankImageMeta(): array#

The image_meta block a fresh upload carries.