[wp-trac] [WordPress Trac] #33771: Include IPTC Keywords in image_metadata array
WordPress Trac
noreply at wordpress.org
Mon Sep 7 17:10:34 UTC 2015
#33771: Include IPTC Keywords in image_metadata array
--------------------------+-----------------------------
Reporter: SteveHoneyNZ | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
IPTC data is already parsed in the attachment metadata process, and use of
IPTC keywords is often requested, and there are a number of plugin
solutions for using keywords and other IPTC meta.
In core currently the comments around IPTC note that it's selecting only
values considered to be "useful" and consistently avaialable. As Adobe and
others have almost universally adopted IPTC tag 2#025 as containing
keywords it would be useful for developers to have access to these in the
image_meta array of attachment_metadata.
The attached demonstrates a small addition to the wp_read_image_metadata
function which adds the keywords as a non-indexed array.
Possible negatives - the array values should potentially be
escaped/sanitized (I'm unsure what the iptc parse function already does in
this respect). Also as attachment_metadata is one serialized db entry
images with exceptionally large amonuts of keywords added may become
bloated, possibly limit to say 99 by trimming array.
As an example use case I was working on a plugin that bulk creates
WooCommerce products from images for print/digital sales, I wanted to add
the keywords as product tags for search purposes. With this addition I was
able to accomplish that.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33771>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list