media file metadata: what drives the choices in wp_read_image_metadata?
-
I’m working on a plugin to read metadata from media
In wp-admin/includes/image.php, in the function wp_read_image_metadata, there’s a metadata array initialized like this:
$meta = array( 'aperture' => 0, 'credit' => '', 'camera' => '', 'caption' => '', 'created_timestamp' => 0, 'copyright' => '', 'focal_length' => 0, 'iso' => 0, 'shutter_speed' => 0, 'title' => '' );
It seems that the only element of this array that actually gets used by WP core is the ‘title’ element (in media.php in function media_handle_upload.). Is that correct?
For some reason the created_timestamp is stored in this array as a UNIX-style 32-bit integer. Is there any reason for that? Will I break core if I change that to a time string?
If the file doesn’t contain photo-specific metadata (aperture, shutter, iso) would my plugin break stuff in core if it removed these items? Would it break stuff in core if I add new items?
I’m considering using a similar array of metadata (the same array, actually, populated by chain of filters) for various kinds of media attachments other than images. (MP3 files, PDFs, etc). Adobe has been pushing an XMP standard, the publishers have IPTC, and there’s EXIF and ID3 metadata as well. So there are lots of sources of useful data.
Is there any core-architecture reason this kind of thing will not work? Thanks.
- The topic ‘media file metadata: what drives the choices in wp_read_image_metadata?’ is closed to new replies.