Make WordPress Core

Changeset 22319


Ignore:
Timestamp:
10/28/2012 04:17:56 PM (14 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/image.php

    r22192 r22319  
    255255                        $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized'] );
    256256                if ( ! empty($exif['FocalLength'] ) )
    257                         $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] );
     257                        $meta['focal_length'] = (string) wp_exif_frac2dec( $exif['FocalLength'] );
    258258                if ( ! empty($exif['ISOSpeedRatings'] ) ) {
    259259                        $meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings'];
     
    261261                }
    262262                if ( ! empty($exif['ExposureTime'] ) )
    263                         $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] );
     263                        $meta['shutter_speed'] = (string) wp_exif_frac2dec( $exif['ExposureTime'] );
    264264        }
    265265
Note: See TracChangeset for help on using the changeset viewer.