wip
This commit is contained in:
@@ -827,7 +827,13 @@ function wp_read_image_metadata( $file ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list( , , $image_type ) = wp_getimagesize( $file );
|
||||
$image_size = wp_getimagesize( $file );
|
||||
|
||||
if ( false === $image_size ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list( , , $image_type ) = $image_size;
|
||||
|
||||
/*
|
||||
* EXIF contains a bunch of data we'll probably never need formatted in ways
|
||||
@@ -967,7 +973,7 @@ function wp_read_image_metadata( $file ) {
|
||||
}
|
||||
|
||||
// If both user comments and description are present.
|
||||
if ( empty( $meta['caption'] ) && $exif_description && $exif_usercomment ) {
|
||||
if ( empty( $meta['caption'] ) && $exif_usercomment ) {
|
||||
if ( ! empty( $meta['title'] ) && $exif_description === $meta['title'] ) {
|
||||
$caption = $exif_usercomment;
|
||||
} else {
|
||||
@@ -1039,13 +1045,13 @@ function wp_read_image_metadata( $file ) {
|
||||
}
|
||||
|
||||
foreach ( array( 'title', 'caption', 'credit', 'copyright', 'camera', 'iso' ) as $key ) {
|
||||
if ( $meta[ $key ] && ! seems_utf8( $meta[ $key ] ) ) {
|
||||
if ( $meta[ $key ] && ! wp_is_valid_utf8( $meta[ $key ] ) ) {
|
||||
$meta[ $key ] = utf8_encode( $meta[ $key ] );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $meta['keywords'] as $key => $keyword ) {
|
||||
if ( ! seems_utf8( $keyword ) ) {
|
||||
if ( ! wp_is_valid_utf8( $keyword ) ) {
|
||||
$meta['keywords'][ $key ] = utf8_encode( $keyword );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user