Make WordPress Core

Ticket #54385: 54385.2.diff

File 54385.2.diff, 976 bytes (added by adamsilverstein, 2 years ago)
  • src/wp-admin/includes/image.php

    diff --git src/wp-admin/includes/image.php src/wp-admin/includes/image.php
    index d8d5d5b34b..1d91f3533c 100644
    function wp_generate_attachment_metadata( $attachment_id, $file ) { 
    647647 * @since 2.5.0
    648648 *
    649649 * @param string $str
    650  * @return int|float
     650 * @return float|string Returns the fraction float, or the original string when
     651 *                          the fraction can't be converted to a float.
    651652 */
    652653function wp_exif_frac2dec( $str ) {
    653654        if ( false === strpos( $str, '/' ) ) {
    function wp_read_image_metadata( $file ) { 
    841842                        $meta['copyright'] = trim( $exif['Copyright'] );
    842843                }
    843844                if ( ! empty( $exif['FNumber'] ) ) {
    844                         $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 );
     845                        $meta['aperture'] = round( (float) wp_exif_frac2dec( $exif['FNumber'] ), 2 );
    845846                }
    846847                if ( ! empty( $exif['Model'] ) ) {
    847848                        $meta['camera'] = trim( $exif['Model'] );