[MGNLDAM-968] Resolving Mime Type via JcrAsset#getMimeType for video with extension .ogv yields 'video/theora' instead of 'video/ogg' Created: 21/May/21  Updated: 11/Nov/21  Resolved: 11/Nov/21

Status: Closed
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: 3.0.7
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Daniel Schneeberger Assignee: Javier Benito
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Assets Maintenance 2
Story Points: 5

 Description   

Steps to reproduce

  1. In Code fetch an Asset that is an .ogv video via DamTemplatingFunctions#getAsset
  2. Call #getMimeType on the retrieved Asset 
  3.  Observe that this call returns 'video/theora' instead of 'video/ogg'

Expected results

  • #getMimeType for a .ogv video asset yields 'video/ogg'

Actual results

  • #getMimeType for a .ogv video asset yields 'video/theora'

Development notes

  • According to https://en.wikipedia.org/wiki/Theora the official MIME type for files with extension .ogv is 'video/ogg'
  • Please note that this happens even though the MIME type mapping configuration in '/server/MIMEMapping/ogv' maps to 'video/ogg'

NOTE: When the asset is uploaded the format is correctly set to video/ogg, once it is stored it is displayed as video/theora



 Comments   
Comment by Javier Benito [ 11/Nov/21 ]

Mime type detection during file upload, before saving it in JCR, is being done with an external library called Tika (_https://tika.apache.org/_). This library, inspects the content of the file to detect the mime type of the content, by looking at the binary packages it has. In the case of OGV videos, it is detecting that they are video/theora, because looking at the bytes of the file, it finds a series of strings that indicate that it is video/theora, as they exist in OGV files.

After having discussed it with miruela and nguyen.phung off the record, we think we can't provide a fix for this at this moment, so closing it.

Generated at Mon Feb 12 05:05:04 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.