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

git-svn-id: https://develop.svn.wordpress.org/trunk@20978 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-06-02 01:39:00 +00:00
parent ee3dfe0301
commit 971e81c326
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'] );
if ( ! empty($exif['FocalLength'] ) )
$meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] );
if ( ! empty($exif['ISOSpeedRatings'] ) )
$meta['iso'] = utf8_encode( trim( $exif['ISOSpeedRatings'] ) );
if ( ! empty($exif['ISOSpeedRatings'] ) ) {
$meta['iso'] = is_array( $exif['ISOSpeedRatings'] ) ? reset( $exif['ISOSpeedRatings'] ) : $exif['ISOSpeedRatings'];
$meta['iso'] = utf8_encode( trim( $meta['iso'] ) );
}
if ( ! empty($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) );
if ( up.features.dragdrop ) {
if ( up.features.dragdrop && ! $(document.body).hasClass('mobile') ) {
uploaddiv.addClass('drag-drop');
$('#drag-drop-area').bind('dragover.wp-uploader', function(){ // dragenter doesn't fire right :(
uploaddiv.addClass('drag-over');