From cf3fe27ca0a406d870801fe636c4e7f12ef81157 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 28 Oct 2012 16:17:56 +0000 Subject: [PATCH] Cast image metadata focal_length and shutter_speed to strings to restore previous behavior when stripslashes_deep() converted these values. Avoids rounding errors without making a determination of which digit we should round to. props jcakec. fixes #22259. git-svn-id: https://develop.svn.wordpress.org/trunk@22319 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/image.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 6ea4edecea..3591231787 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -254,13 +254,13 @@ function wp_read_image_metadata( $file ) { if ( ! empty($exif['DateTimeDigitized'] ) ) $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized'] ); if ( ! empty($exif['FocalLength'] ) ) - $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] ); + $meta['focal_length'] = (string) wp_exif_frac2dec( $exif['FocalLength'] ); if ( ! empty($exif['ISOSpeedRatings'] ) ) { $meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings']; $meta['iso'] = trim( $meta['iso'] ); } if ( ! empty($exif['ExposureTime'] ) ) - $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] ); + $meta['shutter_speed'] = (string) wp_exif_frac2dec( $exif['ExposureTime'] ); } foreach ( array( 'title', 'caption', 'credit', 'copyright', 'camera', 'iso' ) as $key ) {