WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 4 weeks ago

#42017 assigned defect (bug)

Parse the creation date out of uploaded audio files

Reported by: desrosj Owned by: desrosj
Milestone: 4.9.1 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

This is a companion ticket to #35218 which adds parsing for the creation date out of uploaded video files, and will introduce wp_get_media_creation_timestamp().

The same should be done for audio files using the same function.

Attachments (2)

42017.patch (1.8 KB) - added by desrosj 6 weeks ago.
Parse WMA files fir creation date.
test.wma (26.8 KB) - added by desrosj 6 weeks ago.
Test WMA file.

Download all attachments as: .zip

Change History (12)

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


8 weeks ago

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


8 weeks ago

#3 @blobfolio
7 weeks ago

I uploaded a handful of test files to a site and debugged the raw ID3 data. Here is what that turned up:

MP3, FLAC:

None of these had anything like a file creation timestamp, only meta related to the recording like "year".

MPC:

ID3 error: Format not supported, module "module.audio.mpc.php" was removed.

MP4:

This is stored exactly like MP4 video: $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix']

WMA:

Works just like video "asf": $metadata['asf']['file_properties_object']['creation_date_unix']

This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.


7 weeks ago

@desrosj
6 weeks ago

Parse WMA files fir creation date.

@desrosj
6 weeks ago

Test WMA file.

#5 @desrosj
6 weeks ago

  • Keywords has-patch has-unit-tests added; needs-patch removed

In 42017.patch I added the same approach used in wp_read_video_metadata() to wp_read_audio_metadata() (see r41746). Also attached is a test file that should go in the tests/phpunit/data/uploads/ directory.

I talked this over with @blobfolio. The only other file type that may be worth checking is an AAC (Apple audio). I will run some tests on that format when I get a chance.

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


6 weeks ago

#7 @desrosj
6 weeks ago

  • Owner set to desrosj
  • Status changed from new to assigned

#8 @desrosj
6 weeks ago

Looks like the wp-includes/ID3/module.audio-video-asf.php file has an anonymous function in it, so the tests do not pass on PHP 5.2 (https://travis-ci.org/desrosj/wordpress-develop/builds/284383012).

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


4 weeks ago

#10 @joemcgill
4 weeks ago

  • Milestone changed from Awaiting Review to 4.9.1
Note: See TracTickets for help on using tickets.