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

git-svn-id: http://core.svn.wordpress.org/trunk@20978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-06-02 01:39:00 +00:00
parent f3526bbbdd
commit cb71d2fe62
2 changed files with 5 additions and 3 deletions

View File

@ -319,8 +319,10 @@ function wp_read_image_metadata( $file ) {
$meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized'] ); $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized'] );
if ( ! empty($exif['FocalLength'] ) ) if ( ! empty($exif['FocalLength'] ) )
$meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] ); $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] );
if ( ! empty($exif['ISOSpeedRatings'] ) ) if ( ! empty($exif['ISOSpeedRatings'] ) ) {
$meta['iso'] = utf8_encode( trim( $exif['ISOSpeedRatings'] ) ); $meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings'];
$meta['iso'] = utf8_encode( trim( $meta['iso'] ) );
}
if ( ! empty($exif['ExposureTime'] ) ) if ( ! empty($exif['ExposureTime'] ) )
$meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] ); $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] );
} }

View File

@ -417,7 +417,7 @@ jQuery(document).ready(function($){
setResize( getUserSetting('upload_resize', false) ); setResize( getUserSetting('upload_resize', false) );
if ( up.features.dragdrop ) { if ( up.features.dragdrop && ! $(document.body).hasClass('mobile') ) {
uploaddiv.addClass('drag-drop'); uploaddiv.addClass('drag-drop');
$('#drag-drop-area').bind('dragover.wp-uploader', function(){ // dragenter doesn't fire right :( $('#drag-drop-area').bind('dragover.wp-uploader', function(){ // dragenter doesn't fire right :(
uploaddiv.addClass('drag-over'); uploaddiv.addClass('drag-over');