[wp-trac] [WordPress Trac] #20408: wp_read_image_metadata wrongly assumes IPTC metadata is Latin1
WordPress Trac
wp-trac at lists.automattic.com
Tue Apr 10 10:04:35 UTC 2012
#20408: wp_read_image_metadata wrongly assumes IPTC metadata is Latin1
--------------------------+-----------------------------
Reporter: koke | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.4
Severity: normal | Keywords: needs-patch
--------------------------+-----------------------------
Some applications like Aperture, use UTF8 in the IPTC tags. When exported
images are uploaded to WordPress, the title and description metadata has
the wrong encoding
The problem is in [http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-
admin/includes/image.php.source.html#l197 wp_read_image_metadata], since
it runs utf8_encode for every field even if it's already utf8
To check if the parsed iptc is already UTF-8:
{{{
$iptc_is_utf8 = isset( $iptc['1#090'] ) && "\x1B%G" == $iptc['1#090'];
}}}
Depending on that result, the tags should go through utf8_encode or left
as they are
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20408>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list