WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/02/2012 01:39:00 AM (9 years ago)
Author:
azaozz
Message:

Fix notice in wp_read_image_metadata() when EXIF ISOSpeedRatings is array, props nacin, fixes #20807

File:
1 edited

Legend:

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

    r20944 r20978  
    320320        if ( ! empty($exif['FocalLength'] ) )
    321321            $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] );
    322         if ( ! empty($exif['ISOSpeedRatings'] ) )
    323             $meta['iso'] = utf8_encode( trim( $exif['ISOSpeedRatings'] ) );
     322        if ( ! empty($exif['ISOSpeedRatings'] ) ) {
     323            $meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings'];
     324            $meta['iso'] = utf8_encode( trim( $meta['iso'] ) );
     325        }
    324326        if ( ! empty($exif['ExposureTime'] ) )
    325327            $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] );
Note: See TracChangeset for help on using the changeset viewer.