WordPress.org

Make WordPress Core

Ticket #16106: 16106.diff

File 16106.diff, 856 bytes (added by solarissmoke, 5 years ago)

Accept EXIF isoSpeedRatings as either array or string

  • wp-admin/includes/image.php

     
    296296                        $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized'] ); 
    297297                if ( ! empty($exif['FocalLength'] ) ) 
    298298                        $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] ); 
    299                 if ( ! empty($exif['ISOSpeedRatings'] ) ) 
    300                         $meta['iso'] = utf8_encode( trim( $exif['ISOSpeedRatings'] ) ); 
     299                if ( ! empty($exif['ISOSpeedRatings'] ) )  
     300                        $meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? utf8_encode( implode( ',', $exif['ISOSpeedRatings'] ) ) : utf8_encode( trim( $exif['ISOSpeedRatings'] ) ); 
    301301                if ( ! empty($exif['ExposureTime'] ) ) 
    302302                        $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] ); 
    303303        }