Ticket #42017: 42017.diff
File 42017.diff, 1.4 KB (added by , 6 years ago) |
---|
-
src/wp-admin/includes/media.php
3384 3384 $metadata['length_formatted'] = $data['playtime_string']; 3385 3385 } 3386 3386 3387 if ( empty( $metadata['created_timestamp'] ) ) { 3388 $created_timestamp = wp_get_media_creation_timestamp( $data ); 3389 3390 if ( false !== $created_timestamp ) { 3391 $metadata['created_timestamp'] = $created_timestamp; 3392 } 3393 } 3394 3387 3395 wp_add_id3_tag_data( $metadata, $data ); 3388 3396 3389 3397 return $metadata; -
tests/phpunit/tests/media.php
2344 2344 } 2345 2345 2346 2346 /** 2347 * Test created timestamp is properly read from an MP4 file. 2348 * 2349 * This MP4 video file has an AAC audio track, so it can be used to test 2350 *`wp_read_audio_metadata()`. 2351 * 2352 * @ticket 42017 2353 */ 2354 function test_wp_read_audio_metadata_adds_creation_date_with_mp4() { 2355 $video = DIR_TESTDATA . '/uploads/small-video.mp4'; 2356 $metadata = wp_read_audio_metadata( $video ); 2357 2358 $this->assertEquals( 1269120551, $metadata['created_timestamp'] ); 2359 } 2360 2361 /** 2347 2362 * @ticket 35218 2348 2363 */ 2349 2364 function test_wp_read_video_metadata_adds_creation_date_with_quicktime() {