Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recognize OGG as an audio format #26489

Closed
wants to merge 1 commit into from

Conversation

earl-warren
Copy link
Contributor

  • OGG is officially an container format and is therefor classified as application/ogg in RFC3534. While audio/ogg exists, as defined in RFC5334, it doesn't have a different magic number and thus purely informative, it can only be determined by parsing the file and checking if it only contains audio data.
  • A quick search on Wikimedia Commons yields that the OGG container is by far more used for audio than for video, so it's safe to classify this as audio, as OGG files that only contain video would now falsy be classified as an audio file (previously it would've shown just a link to the 'View Raw' link).
  • Added unit tests.
  • Resolves https://codeberg.org/forgejo/forgejo/issues/1091

(cherry picked from commit f5fa1a245236527dd41af4e71b5486c1a39e898a)

- OGG is officially an container format and is therefor classified as
`application/ogg` in RFC3534. While `audio/ogg` exists, as defined in
RFC5334, it doesn't have a different magic number and thus purely
informative, it can only be determined by parsing the file and checking
if it only contains audio data.
- A quick search on Wikimedia Commons yields that the OGG container is
by far more used for audio than for video, so it's safe to classify this
as audio, as OGG files that only contain video would now falsy be
classified as an audio file (previously it would've shown just a link to
the 'View Raw' link).
- Added unit tests.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1091

(cherry picked from commit f5fa1a245236527dd41af4e71b5486c1a39e898a)
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 14, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 14, 2023
@wxiaoguang
Copy link
Contributor

This assumption is not right

https://en.wikipedia.org/wiki/Ogg

The Ogg container format can multiplex a number of independent streams for audio, video, text (such as subtitles), and metadata.

@lunny
Copy link
Member

lunny commented Aug 14, 2023

This assumption is not right

https://en.wikipedia.org/wiki/Ogg

The Ogg container format can multiplex a number of independent streams for audio, video, text (such as subtitles), and metadata.

The extension name is .ogx for application/ogg? Maybe RFC 3534 has been obsoleted by RFC 5334 so we don't need to support application/ogg

In May 2003, two Internet RFCs were published relating to the format. The Ogg bitstream was defined in RFC 3533 (which is classified as 'informative') and its Internet content type (application/ogg) in RFC 3534 (which is, as of 2006, a proposed standard protocol). In September 2008, RFC 3534 was obsoleted by RFC 5334, which added content types video/ogg, audio/ogg and filename extensions .ogx, .ogv, .oga, .spx.

@wxiaoguang
Copy link
Contributor

-> Detect ogg mime-type as audio or video #26494

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants