[wp-meta] [Making WordPress.org] #820: Codex page for wp_read_image_metadata gives wrong order for image meta determination
Making WordPress.org
noreply at wordpress.org
Sun Jan 18 03:02:42 UTC 2015
#820: Codex page for wp_read_image_metadata gives wrong order for image meta
determination
---------------------+-------------------
Reporter: theMikeD | Owner:
Type: defect | Status: new
Priority: normal | Component: Codex
Keywords: |
---------------------+-------------------
The codex page for `wp_read_image_metadata()` describes how the various
meta values are determined by reading IPTC and EXIF info embedded into the
image header. Specifically it outlines the order used to populate the
image metadata. The order shown is wrong for title, copyright, caption and
credit. I've confirmed that it's wrong by making a logic block of the
code, and by testing with the various IPTC and EXIF header info set.
For example, for "title" codex lists the following as the order of
preference:
1. EXIF Title field
2. IPTC Headline field (2#105)
3. IPTC Title field (2#005)
4. IPTC Caption field (2#120) but only if less than 80 characters
5. EXIF ImageDescription field but only if less than 80 characters
Looking at the code, the correct order is
1. IPTC:Headline
2. IPTC:Title
3. IPTC:Description if less than 80 characters
4. EXIF:Title
5. EXIF:Description if less than 80 characters
This is confirmed additionally by looking at the comments in the code, one
of which states:
{{{
* Read IPTC first, since it might contain data not available in
exif such
* as caption, description etc.
}}}
Here are the correct orders:
'''title:'''
1. IPTC:Headline
2. IPTC:Title
3. IPTC:Description if less than 80 characters
4. EXIF:Title
5. EXIF:ImageDescription if less than 80 characters
'''caption:'''
1. IPTC:Description
2. EXIF:UserComment if title is unset AND EXIF:ImageDescription is less
than 80 characters
3. EXIF:ImageDescription if title is set OR EXIF:ImageDescription is more
than 80 characters
4. EXIF:Comments if title !== EXIF:Comments
'''credit:'''
1. IPTC:Credit
2. IPTC:Creator
3. EXIF:Artist
4. EXIF:Author
'''copyright:'''
1. IPTC:Copyright
2. EXIF:Copyright
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/820>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list