WordPress.org

Make WordPress Core

Ticket #22259: image.php.2.patch

File image.php.2.patch, 1.0 KB (added by jcakec, 18 months ago)

Changed the round 4 to round 7 so it rounds according to standards.

  • wp-admin/includes/image.php

     
    254254                if ( ! empty($exif['DateTimeDigitized'] ) ) 
    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'] = round( wp_exif_frac2dec( $exif['FocalLength'] ), 7 ); 
    258258                if ( ! empty($exif['ISOSpeedRatings'] ) ) { 
    259259                        $meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings']; 
    260260                        $meta['iso'] = trim( $meta['iso'] ); 
    261261                } 
    262262                if ( ! empty($exif['ExposureTime'] ) ) 
    263                         $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] ); 
     263                        $meta['shutter_speed'] = round( wp_exif_frac2dec( $exif['ExposureTime'] ), 7 ); 
    264264        } 
    265265 
    266266        foreach ( array( 'title', 'caption', 'credit', 'copyright', 'camera', 'iso' ) as $key ) {