Ticket #42480: 42480.3.diff
File 42480.3.diff, 2.7 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/image.php
357 357 return false; 358 358 } 359 359 360 list( , , $sourceImageType ) = getimagesize( $file );360 list( , , $sourceImageType ) = @getimagesize( $file ); 361 361 362 362 /* 363 363 * EXIF contains a bunch of data we'll probably never need formatted in ways … … 386 386 * as caption, description etc. 387 387 */ 388 388 if ( is_callable( 'iptcparse' ) ) { 389 getimagesize( $file, $info );389 @getimagesize( $file, $info ); 390 390 391 391 if ( ! empty( $info['APP13'] ) ) { 392 $iptc = iptcparse( $info['APP13'] );392 $iptc = @iptcparse( $info['APP13'] ); 393 393 394 394 // Headline, "A brief synopsis of the caption." 395 395 if ( ! empty( $iptc['2#105'][0] ) ) { -
src/wp-admin/includes/media.php
368 368 $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] ); 369 369 } 370 370 371 372 } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) {371 // Use image exif/iptc data for title and caption defaults if possible. 372 } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) { 373 373 if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { 374 374 $title = $image_meta['title']; 375 375 } … … 437 437 $content = ''; 438 438 439 439 // Use image exif/iptc data for title and caption defaults if possible. 440 if ( $image_meta = @wp_read_image_metadata( $file ) ) {440 if ( $image_meta = wp_read_image_metadata( $file ) ) { 441 441 if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { 442 442 $title = $image_meta['title']; 443 443 } -
src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
123 123 $file = $file['file']; 124 124 125 125 // use image exif/iptc data for title and caption defaults if possible 126 $image_meta = @wp_read_image_metadata( $file );126 $image_meta = wp_read_image_metadata( $file ); 127 127 128 128 if ( ! empty( $image_meta ) ) { 129 129 if ( empty( $request['title'] ) && trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {